Fix some replace misuse