Fixed input stream reading.