Fix lag of serial reading by flushing on successful decoding. Check for integer conversion errors.