Bugfix: only checked for newline, not end of file, in readline