Add sanity checks.