Merge safe changes

First merge of the new layout changes into the master branch.