Fix all bugs reported by findbugs plugins. Majority of it was NPE's