Fixed compatibility issue with Java 6