Fix a nasty bug with variable name shadowing
6 files changed