Fix error when ignorecase is unset during replace phase