windows: In some cases, serial ports were not assigned to the correct device, due to an issue with enumeration code. The enumeration code was made more robust to prevent this.