Fix for setting values with strings or actual Date objects.