Complete review of the typings of IR trees.

Now the emitted trees should be correctly typed.