Memory leak cleanup