Fix IndexOutOfBounds when dropping an item.