Replace all occurrences in large search-replace operations

When there are more than 1000 replacements to be done and the replacement string does not contain the search string, not all replacements are made.