Some bug fixes and design changes made