Fix checkstyle errors and lint warnings