(TODO: Maybe this should be stored on map level instead) Fixes issue #3006 Fixes issue #3071 --HG-- branch : trunk