Fixed a bug with reading files.