Prevent selecting a wrong match in getBestMatch().