Fixed compatibility issue with Java 8