pigjar-67 Add invariant checks.