Fixing some code that does not compile with Java 1.5