 							.prependTranslation(0, 0, boneLength * .5)
 							.prependScale(.02, .02, boneLength);
 						
-						target.addChild(boneMesh);
+						joint.addChild(boneMesh);
 					}
 				}
 			}
 		}
-		
-		private function targetRemovedHandler(ctrl 		: AbstractController,
-											  target	: Group) : void
-		{
-			for each (var jointMesh : Mesh in target.get("/mesh[name='__joint__']"))
-				jointMesh.parent = null;
-			
-			for each (var boneMesh : Mesh in target.get("/mesh[name='__bone__']"))
-				boneMesh.parent = null;
-		}
 	}
 }
		}
		
		private function targetAddedHandler(ctrl	: AbstractController,
											target	: Group) : void
		{
			var numChildren : uint = target.numChildren;
			
			for (var i : uint = 0; i < numChildren; ++i)
			{
				var child : Group = target.getChildAt(i) as Group;
				
				if (child != null)
				{

		public function JointsDebugController(jointsMaterial	: Material	= null,
											  bonesMaterial		: Material	= null)
		{
			super(Mesh);
			
			initialize(jointsMaterial, bonesMaterial);
		}
