Weird type tangle was caused by a misisng equality operator.

Working topological-sort. Next is the cycle identification, probably
strongly connected components to start.