Bug fix

Fix global variables to be global again.