Clean up invariant checking