Layout tweaks and bug fixes