         if (llv.minorSize != contentHeight)
         {
             contentHeight = llv.minorSize;
+            containerHeight = Math.max(contentHeight, targetHeight);            
             if ((verticalAlign != VerticalAlign.TOP) && (verticalAlign != VerticalAlign.JUSTIFY))
             {
                 for (index = startIndex; index <= endIndex; index++)
                 {
                     elt = layoutTarget.getLayoutElementAt(index);
                     h = calculateElementHeight(elt, targetHeight, contentHeight);
-                    y = calculateElementY(elt, h, contentHeight);
+                    y = calculateElementY(elt, h, containerHeight);
                     elt.setLayoutBoundsPosition(elt.getLayoutBoundsX(), y);
                     elt.setLayoutBoundsSize(elt.getLayoutBoundsWidth(), h);
                 }

        if (verticalAlign == VerticalAlign.JUSTIFY)
            restrictedHeight = targetHeight;
        else if (verticalAlign == VerticalAlign.CONTENT_JUSTIFY)
            restrictedHeight = contentHeight;

        distributeWidth(targetWidth, targetHeight, restrictedHeight);    
        

                continue;
                
            // Set the layout element's position
            var y:Number = (containerHeight - layoutElement.getLayoutBoundsHeight()) * vAlign;
            layoutElement.setLayoutBoundsPosition(x, y);
            
            // Update maxX,Y, first,lastVisibleIndex, and x
