fix and tests for null date values