Fix data serialization