Added rules for cases where Jaccard index becomes NaN.