                 _initialized[nodeId] = INIT_LOCAL_TO_WORLD;
                 root.localToWorldTransformChanged.execute(root, rootLocalToWorld);
             }
-            
-            for (; nodeId < numNodes; ++nodeId)
+
+            if (lastChildId > subtreeMax)
+                subtreeMax = lastChildId;
+            
+            while (nodeId < numNodes)
             {
                 var localToWorld 	: Matrix4x4	= _localToWorldTransforms[nodeId];
                 var numChildren		: uint		= _numChildren[nodeId];

            
            while (nodeId >= 0)
            {
                if ((_transforms[nodeId] as Matrix4x4)._hasChanged ||
                    !_initialized[nodeId])
                    dirtyRoot = nodeId;
                
                nodeId = _parentId[nodeId];
            }
            
            if (dirtyRoot >= 0)
                updateLocalToWorld(dirtyRoot);
        }
        
        private function targetAddedHandler(ctrl	: TransformController,

                        child.localToWorldTransformChanged.execute(child, childLocalToWorld);
                    }
                }
                
                if (subtreeOnly && nodeId && nodeId >= subtreeMax)
                {
                    var parentId : uint = _parentId[nodeId];
                    
                    nodeId = _firstChildId[parentId];
                    while (!_numChildren[nodeId] && nodeId < subtreeMax)
                        ++nodeId;
                    
                    if (nodeId >= subtreeMax)
                        return ;
                    
                    nodeId = _firstChildId[nodeId];
                }
                else
                    ++nodeId;
            }
        }
        
