Fix different hdu number in compressed files.  Also, closes #362 and closes #880