Some fixes and design changes