Fix search and replace errors