Fix same reference deletion.