More memory cleanups