Fix a number of findbugs warnings