fix bridging flags and improve path logic