Fixing variable name bug introduced in ac8950f

Fixes #8617