Fix compilation with Java 6.
Merge pull request #31 from tomwhite/java6-compilation-fixes

Fix compilation with Java 6.
Thanks @tomwhite