Fix mega memory leak