Fix FITS writing