detectDisjointSubgraphs() appears to be working with these changes. Previously, I was indexing into the wrong node list, which was giving me undefined nodes, and messing everything up.