Fixed bugs and style