fix some graph bugs