unit test and checkstyle improvements