Support filenames like prefix.XXXX.fits.gz. Fixes #10.