Improved functionality: corrupt file names are saved to a logfile.