Implement some sanity checks.