Add some sanity checking