Fixed being able to load non-existing map.
Refactored.