Rolled closure to latest master, making sure that it functions correctly with Java 7.