Fix for Java 6/7