Catch error if no lines can be counted on stream, fixes #15