Fix IsBipartite(graph) and HasCycle(graph).