Fix code that does not compile with Java 1.5