[FIX] Minor bug fixes, motivated by FindBugs warnings.