Fix crash when removing from an empty array.