More efficient sanity check