 					curx = 0;
 				}
 			}
-			
+			if (!hasWidth && n > 0 && !isNaN(maxWidth) && 
+                (!(ValuesManager.valuesImpl.getValue(host, "left") !== undefined) &&
+                  (ValuesManager.valuesImpl.getValue(host, "right") !== undefined)))
+            {
+                lastWidth = maxWidth;
+                host.setWidth(maxWidth, true);
+            }
+            if (!hasHeight && n > 0 && !isNaN(maxHeight) && 
+                (!(ValuesManager.valuesImpl.getValue(host, "top") !== undefined) &&
+                    (ValuesManager.valuesImpl.getValue(host, "bottom") !== undefined)))
+            {
+                lastHeight = maxHeight;
+                host.setHeight(maxHeight, true);
+            }
 			return true;
 		}
 	}

			var curx:int = 0;
			var cury:int = 0;
			var maxHeight:int = 0;
			col = 0;
			for (i = 0; i < n; i++) 
            {

				e.y = cury + data[i].mt;
				curx += columns[col++];
                maxHeight = Math.max(maxHeight, e.y + e.height + data[i].mb);
                maxWidth = Math.max(maxWidth, e.x + e.width + data[i].mr);
				if (col == numColumns)
				{
					cury += rows[0].rowHeight;
