Fixing Java 6 problems