TypeEnv collection and start of flatten.