Added garbage collection to some Python examples.