Fix Java 6 incompatibility