Also handle circular references in types and environments without exploding, and tweak test output a little bit.