Fix bug where only one connection was being created between vertices in undirected graphs