Fix removal of multiple items from alias array

Removing items from an array which is being iterated orver does not
work.  Storing items and removing them after all removed indexes are
determined.
Merge remote-tracking branch 'origin/Fix-removing-of-aliases'