Fix checkstyle and add more tests.