Add some more tests to ensure reasonable invariants are enforced.