Fix giant memory leak