Revert "Remove useless serialization bits"

This reverts commit ab6627ebc17bbc992327cfb916a64660df14b560.