Fixed two map related bugs