Fixed other NPE when writing netCDF output