Various tweaks to improve the file-to-data conversion's safety.