Provide more informative debug output.
Fix memory leak.

The python wrapper wasn't properly dereferenced.