Fix bug in routing sets with scope of "if" statement