BUG: subst: With multiple replacements, only the last applies.

Need to initialize and modify $newtodo instead of $todo.