Update coding style & fix tests