Fixed a critical scoping bug.