Fix message serialization bug.