Handle EOF on config file reading better