Added sanity checks