fixed issue #63 relating to writing of NULL values