Fixed issues with reading multiple lines and handling of end-of-line
when reading via System.in stream.