Replace check for stream_chunk < 0 by state == NONE.