Finally fixed the way bytes read/written are counted for non-seekable streams. Seriously this time. All tests passing!