Fixed a few issues identified by FindBugs.