Bug fixes and layout