Fix encoding of structs containing arrays containing non-structs