finished function for checking the
header of a file to see if it's an archive type, and fixed a few other errors involved in other functions related to exiting on error