Findbugs : Fix a number of potential NPEs and minor findings