         // Make sure that if the content spans partially over a pixel to the right/bottom,
         // the content size includes the whole pixel.
         var paddedContentWidth:Number = Math.ceil(contentWidth + paddingLeft + paddingRight);
-        var paddedContentHeight:Number = Math.ceil(llv.end(llv.length - 1) + paddingBottom);
+        var paddedContentHeight:Number = Math.ceil(contentHeight + paddingTop + paddingBottom);
         layoutTarget.setContentSize(paddedContentWidth, paddedContentHeight);
     }
     

    //
    //--------------------------------------------------------------------------
    
    /**
     * @private
     */

        // Distribute the extra space among the flexible children
        if (totalPercentHeight)
        {
            Flex.flexChildrenProportionally(height,
                                            spaceToDistribute,
                                            totalPercentHeight,
                                            childInfoArray);

            var roundOff:Number = 0;            
            for each (childInfo in childInfoArray)
