Add r_buf_read/write methods using CUR, fix some more warnings