More serialisation/deserialisation fixes