 		if (n == 0)
 			return;
 
-		// The old TextLines might have been added to a different
-		// container than the one we'd use now to add new TextLines.
-		var container:DisplayObjectContainer =
-			textLines[0].parent;
-
 		for (var i:int = 0; i < n; i++)
 		{
-			var textLine:DisplayObject = textLines[i];			
-            UIComponent(container).$removeChild(textLine);
+			var textLine:DisplayObject = textLines[i];	
+            var parent:UIComponent = textLine.parent as UIComponent;
+            if (parent)
+                UIComponent(textLine.parent).$removeChild(textLine);
 		}
 	}
 

    {
        if (!validateBaselinePosition())
            return NaN;
        
        // Return the baseline of the first line of composed text.
        return textLines.length > 0 ? textLines[0].y : 0;

     *  @private
     *  The value of bounds.width, before the compose was done.
     */
    mx_internal var _composeWidth:Number;

    /**
     *  @private
     *  The value of bounds.height, before the compose was done.
     */
    mx_internal var _composeHeight:Number;
    
    /**
     *  @private
