Fixed incorrect implementation of the get_port() method for routers