Track the node numbers when matching, not just the ways.