FIX: issue #667 ('replace crashing Red)
Merge pull request #668 from qtxie/issue-667

FIX: issue #667 ('replace crashing Red)