Allow read() calls on exhausted streams.
Fix header parsing bug.