Fix various routing and route generation errors