Better handling of closed and ended files in OFFile.