Fixed all bugs found by FindBugs