Fixed some more issues found by findbugs and pmd