 		// The nestLevel setter will recursively set it on any
 		// descendants of the child that exist.
 		if (child is ILayoutManagerClient)
-        	ILayoutManagerClient(child).nestLevel = systemManager.nestLevel + 1;
+        	ILayoutManagerClient(child).nestLevel = nestLevel + 1;
 
 		if (child is InteractiveObject)
-			if (systemManager.doubleClickEnabled)
+			if (InteractiveObject(systemManager).doubleClickEnabled)
 				InteractiveObject(child).doubleClickEnabled = true;
 
 		if (child is IUIComponent)
-			IUIComponent(child).parentChanged(systemManager);
+			IUIComponent(child).parentChanged(DisplayObjectContainer(systemManager));
 
 		// Sets up the inheritingStyles and nonInheritingStyles objects
 		// and their proto chains so that getStyle() works.

		
		// non-top level system managers may not be able to reference their parent if
		// they are a proxy for popups.
		if (!systemManager.topLevel && systemManager.parent)
		{
			// non-topLevel SystemManagers are buried by Flash.display.Loader and
			// other non-framework layers so we have to figure out the nestlevel
			// by searching up the parent chain.
			var obj:DisplayObjectContainer = systemManager.parent.parent;
			while (obj)
			{
				if (obj is ILayoutManagerClient)

				obj = obj.parent;
			}
		}
		nestLevel = newNestLevel;

		if (child is IUIComponent)
			IUIComponent(child).systemManager = systemManager;
