Fix uart read/write