Add basic sanity checking.