Fix issue 12890 - index based replace & insert

https://issues.dlang.org/show_bug.cgi?id=12890

I haven't inspected the code yet, but lets not let this fall off the map again.