Fixes for Java 7