Fixed a bug in the opening of the file.