Fixed EOF implementation...this is the only way it actually works
without file read errors.