Java 7 support, probably very stupid modification