Fix validation and round-tripping