Fix memory leak by removing clone when scope is destroyed.