Deal gracefully with EOF