bug fixes in the avro writer