Issue #91: additional cleanup to ensure proper memory alloc/delloc in python module