Undo bugs introduced by commit bf6fb509 (undesirable search/replace refactor behavior)