Fix groupings serialization/deserialization discrepancies