Fixing search and replace issues