Fixed some of the checkstyle and findbugs problems