checkstyle and code formatting fixes