Fix cdist miscounting case-sensitive lookup fields.