Added support for writing null values