             if (!layoutElement || !layoutElement.includeInLayout)
                 continue;
 
-            var hCenter:Number = LayoutElementHelper.parseConstraintValue(layoutElement.horizontalCenter);
-            var vCenter:Number = LayoutElementHelper.parseConstraintValue(layoutElement.verticalCenter);
-            var baseline:Number      = LayoutElementHelper.parseConstraintValue(layoutElement.baseline);
-            var left:Number    = LayoutElementHelper.parseConstraintValue(layoutElement.left);
-            var right:Number   = LayoutElementHelper.parseConstraintValue(layoutElement.right);
-            var top:Number     = LayoutElementHelper.parseConstraintValue(layoutElement.top);
-            var bottom:Number  = LayoutElementHelper.parseConstraintValue(layoutElement.bottom);
-            var percentWidth:Number  = layoutElement.percentWidth;
-            var percentHeight:Number = layoutElement.percentHeight;
+            var hCenter:Number          = LayoutElementHelper.parseConstraintValue(layoutElement.horizontalCenter);
+            var vCenter:Number          = LayoutElementHelper.parseConstraintValue(layoutElement.verticalCenter);
+            var baseline:Number         = LayoutElementHelper.parseConstraintValue(layoutElement.baseline);
+            var left:Number             = LayoutElementHelper.parseConstraintValue(layoutElement.left);
+            var right:Number            = LayoutElementHelper.parseConstraintValue(layoutElement.right);
+            var top:Number              = LayoutElementHelper.parseConstraintValue(layoutElement.top);
+            var bottom:Number           = LayoutElementHelper.parseConstraintValue(layoutElement.bottom);
+            var percentWidth:Number     = layoutElement.percentWidth;
+            var percentHeight:Number    = layoutElement.percentHeight;
             
-            var elementMaxWidth:Number = layoutElement.getMaxBoundsWidth();
-            var elementMaxHeight:Number = layoutElement.getMaxBoundsHeight();
+            var elementMaxWidth:Number = NaN; 
+            var elementMaxHeight:Number = NaN;
 
             // Calculate size
             var childWidth:Number = NaN;

                     availableWidth -= right;

                childWidth = Math.round(availableWidth * Math.min(percentWidth * 0.01, 1));
                elementMaxWidth = Math.min(elementMaxWidth,
                    maxSizeToFitIn(unscaledWidth, hCenter, left, right, layoutElement.getLayoutBoundsX()));
            }
            else if (!isNaN(left) && !isNaN(right))

                    availableHeight -= bottom;    
                    
                childHeight = Math.round(availableHeight * Math.min(percentHeight * 0.01, 1));
                elementMaxHeight = Math.min(layoutElement.getMaxBoundsHeight(),
                    maxSizeToFitIn(unscaledHeight, vCenter, top, bottom, layoutElement.getLayoutBoundsY()));
            }
            else if (!isNaN(top) && !isNaN(bottom))
