This builds on the invariant checks introduced in 1519629a, and adds a couple more than seem to hold without additional work.