Fixed a bug with getline() failing at the EOF.