Fix disconnect handling and routing