Moving array item into other array item

A tiny fix for the case of moving an array item *into* another array item whose indices collide after removing the first (see unit test for example). Not sure if this might introduce some other problem, but it seems to solve the issue in my use case.