Fixes JSON serialization of datetimes.