Exit gracefully if an external function name is used as a model local variable.

Closes #599