Tweak matching to better prioritize shorter matches