Fix checkstyle errors and formatting issues