fix Writer.format issue with null values