Fix serialization of domains