Fixed a family of subtle race conditions that could lead to inconsistencies in the global routing state.