Better handling at the end of a read buffer.