Fix crashes caused by missing globals