Fix get_serial_ports function