Fixed IndexOutOfBoundsException for List#remove, and added corresponding UT.