Added fitContent mode for layouts, tightened up preferred size calc