Fixed exception showing up because of the adjacency list being created incorrectly