Fix reference error if globalOptions is undefined.