Fix various findbugs as reported by jenkins.