Small fixes for bugs reported by FindBugs plugin