More memory leak cleanup