Fix bug with replacements.