Fixed typo in ports_of_switch function