Added test that reveals a problem with generation of named invariant types (e.g. Str = seq of char)
Fix for generation of named invariant type