Added graph sanity checks