Add ref coercions to deserialize routine