Rewrite the copying loop slightly; scratch.grow has an assert offset == 0 so moved this reset up before grow.