Fix a bug in the replacing algorithm.
Merge branch 'master' of https://github.com/hexafluoride/qdhe