Bug fixes and design clean up