Fix exception (getline will trigger failbit on the last line)