Codestyle fixes + testing improvement