Bug fix: Scoping