Fixed some issues reported by FindBungs tool