Fix some issues reported by FindBugs