fixing bugs found by FindBugs