Correct stupid results of automated string replacement