Fixed strange bug due to not offsetting the write buf.
Merging