Fixed reading from first file and error messages