Generate complex types. Fixes #3