Miscellaneous updates for moving to Java 5