fixed error when ExtendReplace flag is on
2 files changed