Added support for Java 6