Fixed type-meet to better combine distributed union.
Casts appear to work with heapification now. Fixed up lang-variants-of-arity to better handle free variables.