Fixing codestyle, typo and unittests