Some search/replace improvements