Also, rename the variable to have a more manageable name, and make its scope more clear. Fixes bug 24582; bugfix on 0.2.1.1-alpha.