Fixing up issues with global vs map mode detection