Fixing ReplaceVariables script.