--- Sample.py.orig	2016-05-04 17:48:07.079910973 +0000
+++ Sample.py	2016-05-04 17:55:18.551256991 +0000
@@ -41,93 +41,101 @@
         print("Frame id: %d, timestamp: %d, hands: %d, fingers: %d, tools: %d, gestures: %d" % (
               frame.id, frame.timestamp, len(frame.hands), len(frame.fingers), len(frame.tools), len(frame.gestures())))
 
-        # Get hands
-        for hand in frame.hands:
-
-            handType = "Left hand" if hand.is_left else "Right hand"
-
-            print("  %s, id %d, position: %s" % (
-                handType, hand.id, hand.palm_position))
-
-            # Get the hand's normal vector and direction
-            normal = hand.palm_normal
-            direction = hand.direction
-
-            # Calculate the hand's pitch, roll, and yaw angles
-            print("  pitch: %f degrees, roll: %f degrees, yaw: %f degrees" % (
-                direction.pitch * Leap.RAD_TO_DEG,
-                normal.roll * Leap.RAD_TO_DEG,
-                direction.yaw * Leap.RAD_TO_DEG))
-
-            # Get arm bone
-            arm = hand.arm
-            print("  Arm direction: %s, wrist position: %s, elbow position: %s" % (
-                arm.direction,
-                arm.wrist_position,
-                arm.elbow_position))
-
-            # Get fingers
-            for finger in hand.fingers:
-
-                print("    %s finger, id: %d, length: %fmm, width: %fmm" % (
-                    self.finger_names[finger.type],
-                    finger.id,
-                    finger.length,
-                    finger.width))
-
-                # Get bones
-                for b in range(0, 4):
-                    bone = finger.bone(b)
-                    print("      Bone: %s, start: %s, end: %s, direction: %s" % (
-                        self.bone_names[bone.type],
-                        bone.prev_joint,
-                        bone.next_joint,
-                        bone.direction))
-
-        # Get tools
-        for tool in frame.tools:
-
-            print("  Tool id: %d, position: %s, direction: %s" % (
-                tool.id, tool.tip_position, tool.direction))
-
-        # Get gestures
-        for gesture in frame.gestures():
-            if gesture.type == Leap.Gesture.TYPE_CIRCLE:
-                circle = CircleGesture(gesture)
-
-                # Determine clock direction using the angle between the pointable and the circle normal
-                if circle.pointable.direction.angle_to(circle.normal) <= Leap.PI/2:
-                    clockwiseness = "clockwise"
-                else:
-                    clockwiseness = "counterclockwise"
-
-                # Calculate the angle swept since the last frame
-                swept_angle = 0
-                if circle.state != Leap.Gesture.STATE_START:
-                    previous_update = CircleGesture(controller.frame(1).gesture(circle.id))
-                    swept_angle =  (circle.progress - previous_update.progress) * 2 * Leap.PI
-
-                print("  Circle id: %d, %s, progress: %f, radius: %f, angle: %f degrees, %s" % (
-                        gesture.id, self.state_names[gesture.state],
-                        circle.progress, circle.radius, swept_angle * Leap.RAD_TO_DEG, clockwiseness))
-
-            if gesture.type == Leap.Gesture.TYPE_SWIPE:
-                swipe = SwipeGesture(gesture)
-                print("  Swipe id: %d, state: %s, position: %s, direction: %s, speed: %f" % (
-                        gesture.id, self.state_names[gesture.state],
-                        swipe.position, swipe.direction, swipe.speed))
-
-            if gesture.type == Leap.Gesture.TYPE_KEY_TAP:
-                keytap = KeyTapGesture(gesture)
-                print("  Key Tap id: %d, %s, position: %s, direction: %s" % (
-                        gesture.id, self.state_names[gesture.state],
-                        keytap.position, keytap.direction ))
-
-            if gesture.type == Leap.Gesture.TYPE_SCREEN_TAP:
-                screentap = ScreenTapGesture(gesture)
-                print("  Screen Tap id: %d, %s, position: %s, direction: %s" % (
-                        gesture.id, self.state_names[gesture.state],
-                        screentap.position, screentap.direction ))
+        try:
+            # Get hands
+            for hand in frame.hands:
+
+                handType = "Left hand" if hand.is_left else "Right hand"
+
+                print("  %s, id %d, position: %s" % (
+                    handType, hand.id, hand.palm_position))
+
+                # Get the hand's normal vector and direction
+                normal = hand.palm_normal
+                direction = hand.direction
+
+                # Calculate the hand's pitch, roll, and yaw angles
+                print("  pitch: %f degrees, roll: %f degrees, yaw: %f degrees" % (
+                    direction.pitch * Leap.RAD_TO_DEG,
+                    normal.roll * Leap.RAD_TO_DEG,
+                    direction.yaw * Leap.RAD_TO_DEG))
+
+                # Get arm bone
+                arm = hand.arm
+                print("  Arm direction: %s, wrist position: %s, elbow position: %s" % (
+                    arm.direction,
+                    arm.wrist_position,
+                    arm.elbow_position))
+
+                # Get fingers
+                for finger in hand.fingers:
+
+                    print("    %s finger, id: %d, length: %fmm, width: %fmm" % (
+                        self.finger_names[finger.type],
+                        finger.id,
+                        finger.length,
+                        finger.width))
+
+                    # Get bones
+                    for b in range(0, 4):
+                        bone = finger.bone(b)
+                        print("      Bone: %s, start: %s, end: %s, direction: %s" % (
+                            self.bone_names[bone.type],
+                            bone.prev_joint,
+                            bone.next_joint,
+                            bone.direction))
+        except SystemError:
+            pass
+
+        try:
+            # Get tools
+            for tool in frame.tools:
+                print("  Tool id: %d, position: %s, direction: %s" % (
+                    tool.id, tool.tip_position, tool.direction))
+        except SystemError:
+            pass
+
+        try:
+            # Get gestures
+            for gesture in frame.gestures():
+                if gesture.type == Leap.Gesture.TYPE_CIRCLE:
+                    circle = CircleGesture(gesture)
+
+                    # Determine clock direction using the angle between the pointable and the circle normal
+                    if circle.pointable.direction.angle_to(circle.normal) <= Leap.PI/2:
+                        clockwiseness = "clockwise"
+                    else:
+                        clockwiseness = "counterclockwise"
+
+                    # Calculate the angle swept since the last frame
+                    swept_angle = 0
+                    if circle.state != Leap.Gesture.STATE_START:
+                        previous_update = CircleGesture(controller.frame(1).gesture(circle.id))
+                        swept_angle =  (circle.progress - previous_update.progress) * 2 * Leap.PI
+
+                    print("  Circle id: %d, %s, progress: %f, radius: %f, angle: %f degrees, %s" % (
+                            gesture.id, self.state_names[gesture.state],
+                            circle.progress, circle.radius, swept_angle * Leap.RAD_TO_DEG, clockwiseness))
+
+                if gesture.type == Leap.Gesture.TYPE_SWIPE:
+                    swipe = SwipeGesture(gesture)
+                    print("  Swipe id: %d, state: %s, position: %s, direction: %s, speed: %f" % (
+                            gesture.id, self.state_names[gesture.state],
+                            swipe.position, swipe.direction, swipe.speed))
+
+                if gesture.type == Leap.Gesture.TYPE_KEY_TAP:
+                    keytap = KeyTapGesture(gesture)
+                    print("  Key Tap id: %d, %s, position: %s, direction: %s" % (
+                            gesture.id, self.state_names[gesture.state],
+                            keytap.position, keytap.direction ))
+
+                if gesture.type == Leap.Gesture.TYPE_SCREEN_TAP:
+                    screentap = ScreenTapGesture(gesture)
+                    print("  Screen Tap id: %d, %s, position: %s, direction: %s" % (
+                            gesture.id, self.state_names[gesture.state],
+                            screentap.position, screentap.direction ))
+        except SystemError:
+            pass
 
         if not (frame.hands.is_empty and frame.gestures().is_empty):
             print("")
