1.0.3dev: Fixed regressions in [13420]. Refs #11850.

The value for `name` would not always be properly captured from the outer scope.


git-svn-id: http://trac.edgewall.org/intertrac/log:/branches/1.0-stable@13425 af82e41b-90c4-0310-8c96-b1721e28e2e2