Code cleanup and additional debug information for COM port detection in the firmware config