Assign global variables in the global scope.

Previously they would be incorrectly stored in the current scope only.