 
             for (i = 0; i < n; i++)
             {
-                child = IUIComponent(getChildAt(i));
+                child = getLayoutChildAt(i);
 
                 // Round up to nearest 1/4 of controlWidth
                 if (!isNaN(child.percentWidth))


                for (i = 0; i < n; i++)
                {
                    child = IUIComponent(getChildAt(i));
                    child.move(Math.floor(left), top);
                    left += child.width + horizontalGap;
                }

                // Determine the widest child.
                for (i = 0; i < n; i++)
                {
                    child = getLayoutChildAt(i);
                    maxWidth = Math.max(maxWidth,
                                        child.getExplicitOrMeasuredWidth());
                }
