Fix array when adding to new index at the end.