Added exceptions to the stream reading.