Fix bug when editing the source in a rewrite.