Corrected write from serialport.