Fix Java 6 compatibility