Debug tests for invariants. #36