Fixed bugs and comments