fix tests and format