fixes in typesStack generation