Fix string replacement