Make some allocations 1 byte larger, since replace_pairs() may access
one element beyond the array bound.