Patched memory leaks relating to closures.