fix code style and fix broken tests