Fix #1117: Fix the double download problem (again) when identifying the file type.  Also gracefully handle invalid units in a FITS file.