Fixed extended replace bug.