Fixed a bug that lead to infinite recursion when an error occured while
opening the serial port