On map load, moved map.objectIdCounter assignment to an earlier stage. This fixes Array reusing object ids.