Fixed some of the problems reported by PMD.