Fix for wrong-order index shift

Shifting indices before removing items can cause the wrong items in the
derived collection to be removed.