layout and bug fixes