Fixed bugs with map drawing