Added serial port error handling. Fixing logs.