Some bugs and design changes