Fix compression serialization error and implement deserialization.