Fixed some bugs and blocked some segfault cases, now I can generate a minimal graph