Rewrite substitute to clone the substitution range.