Fixing bug where the unclean file wasn't removed after doing an integrity check