cleaning up code and search/replace errors