fix editing of NULL values

fixes 0 to NULL
fixes setting of NULL values in postgres