Up to Java 7

Fix some warnings with new Java 7 features.