Added some sanity check stuff, forgot to commit it, day or three ago.