Backport UndefinedVariableError fix from master
3 files changed