Added checkstyle and fixed code to obey it (thanks @meggawatts).