I cannot reproduce this. Are you sure you don't have a user defined function called Replace in your functions.kix file? If you properly format the call statement with the variable outside of the quotes does it help?

Call $SCRIPTPATH + "\Functions.kix"