Cleanup some mem management.