Consider custom sort compare function for port lists that sorts alphanumerically, so cases like COM1 COM10 COM2 are instead sorted as COM1 COM2 COM10 as if they had been COM01, COM02 and COM10, respectively. Also, use case-insensitive sort.