Better support for large layouts
Merge pull request #1240 from jsexauer/fix_layout

Better support for large layouts