Reimplement index_tuple_replace.