Fixed a bug in ChangeVariables. Even derivative replacements should only
be from functions in validFunctions list.