Improved writing HISTORY cards in FITS header