Corrected error in file handling.