Fixed repace with replace bug.