Variable scope fix.