Fixed memory reading in map.cpp and added a few TODO stuff