Fixed a bug in create replacements