Fixed some minor possible bugs reported by FindBugs