Fixing a bug in xzero of new graph. Also beefing up error checking, although it mostly already looks good.