Map server crash fixes
- Fixed two parts of the code that could lead to a map server crash