Fix various findbugs as reported by jenkins.

There were a few findbugs issues with this class which seemed like an excellent afternoon project.