Fixes for Java 1.7 builds.
Fixing some FindBugs findings.