I am now also using reification to obtain the indexes corresponding to the stuff we want to cancel instead of relying on matching using Ltac.