Fixed a bug where the map occasionally crashes due to a NPE, fixes #51