Change these sed lines to behave correctly when the input string