various memory cleanup cleanups