Add some sanity checks.

Signed-off-by: John McCutchan <john@johnmccutchan.com>