Fix array element insertion

if the add operation wants to add an element at the index correpsonding
to the array size, it is correct according to the RFC.