Made addGlobal initialize extension globals if globals is null.