Codestyle fixes and unit test correction