Fix an IndexOutOfBoundsException that occurred when removing the final item in ones list