Fix the infinite-routing-loop bug completely