Made most of the all-at-once unit tests work, but one still fails type checking due to the use of a lexical closure in the calculated principal type.