Fix bug in matcher logic for non-greedy grains matches