Add possible fix to replace-first error when match is string.