fixed crash when no OSM
Fixed bug in flag check
Fixed conflict