Fixing memory leaks and the exploding Python stuff