Fix broken Java 6 support