Remove obsolete invariant-checking code