Bug fix that correctly initializes global variables.