Fixed a problem with the HasReachedEof method.