Fix a bug in rb_read() causing a packet corruption