This has a lower chance to give an impression that the substitution happens in-place. Closes gitlab issue #237