Address FindBugs warnings

This commit fixes 36 of the 109 warnings.