Fixed a bug with recognizing adjacent routers