Added a lot more hooks to catch problematic files in the prepare_files script.