Fixes datetime and string encoding.