         if (controlBar && controlBar.includeInLayout)
             newControlBarHeight = controlBar.getExplicitOrMeasuredHeight();
 
-        if (newControlBarHeight != oldControlBarHeight)
-            _borderMetrics = null;
-        
-        if (hHeight != oldHeaderHeight)
-            _borderMetrics = null;
+        if (newControlBarHeight != oldControlBarHeight &&
+          	!(isNaN(oldControlBarHeight) && isNaN(newControlBarHeight)))
+            _panelBorderMetrics = null;
+        
+        if ((hHeight != oldHeaderHeight) && 
+        	!(isNaN(hHeight) && isNaN(oldHeaderHeight)))
+            _panelBorderMetrics = null;
                 
-        if (_borderMetrics)
-            return _borderMetrics;
+        if (_panelBorderMetrics)
+            return _panelBorderMetrics;
 
         var o:EdgeMetrics = super.borderMetrics;
         var vm:EdgeMetrics = new EdgeMetrics(0, 0, 0, 0);

    	if (getStyle("borderStyle") == "default")
        	return EdgeMetrics.EMPTY;
        else
        	return super.getBackgroundColorMetrics();
    }

   	/**

        if (!isNaN(newControlBarHeight))
            vm.bottom += newControlBarHeight;
        
        _panelBorderMetrics = vm;
        
        return _panelBorderMetrics;
    }

	/**
	 *  @private
	 *  If borderStyle may have changed, clear the cached border metrics.
	 */
	override public function styleChanged(styleProp:String):void
	{
		super.styleChanged(styleProp);
		
		if (styleProp == null ||
			styleProp == "styleName" ||
			styleProp == "borderStyle" ||
			styleProp == "borderThickness" ||
			styleProp == "borderSides")
		{
			_panelBorderMetrics = null;
		}
		
		invalidateDisplayList();
	}

    /**
     *  @private
