Fix coding standards and some mistakes