Add Java 8 compatibility. Minor fixes.