Fixed compatibility with Java 8