Check variable scoping