fix several problems and styles