Fixed bug with reading files.