partial read/write bug fixes