Check invariant