Fixed reading of input sequence

Skip comments between blocks
Handle premature EOF gracefully
Added error output on premature stream end