Fix writing header with scale == None