Fixed to run on Java 8