Fix some sanity checking.