Fix not working with Java 1.6 and 1.8