Various improvements to the serialization of compound types
Added more tests