Fixing typecheck. WIP for transitive closures.
Fixed typecheck for transitive closure relations. The key is to save the newly created relations.