Fixed a bug for generating composite types nested inside a sequence