Fixed bug in determining connections to the router