fixed some bugs related to directed vs. undirected graphs, and the tricky test now passes