Fixed some checkstyle and pmd errors