Quick fix for undefined variable.

This was fixed in another pull request that is not yet merged, but it is just bad to have the problem in 3.0. Fixes #3980