Improve mreplace.