Fix code and style