Make trees after TailRec type correct. Move Ycheck after tailrec

Includes #144