Changes to support building with Java 5