Fix undefined variable access.
Merge pull request #1698 from Ventero/pr-1698

Fix undefined variable access.