Fix findbugs and pmd warnings.