fixes issue #852 by making sure the map is initialized before any interaction with it.
Merge pull request #853 from ne0fhyk/fix_issue_852

Fixes issue #852