Fixes bug #3071.

If we have perfect matches (min_dist == 0.0), then strict comparison
fails. Making it non-strict results in treating perfect matches as
good.
Merge pull request #988 from snosov1:3071-fix