Added sanity checks.