Fixes to layout system

Bugfixes garnered from testing on sexy test server.