Various fixes

This fixes various errors I encountered in map_server and insert_osm_data