Fix cleaning up instances