Fixing bug on replacements.