added a couple of sanity checks.