Fix delete-after-delete bug.