Clean up resources in destructor
Added memory debugging options