Ok, this is fixed now. According to my logs, this is the third bug in the ReplaceStr() found by Paul... so congratulations to your hat trickHi Andreas,
There seems to be a bug with ReplaceStr() that shows up if it finds too many of the same thing to replace. The attached crashlog was produced from the following code:

