Fixed custom route matching to select by nodes instead of distances