merging in Lydias changes from the routing_errors branch