[p] Fix strings and datetime not being written to the file correctly.