Encode embedded structs