Fixed minor bugs found by FindBugs