fix for negative substring length for top-level category_path matching data_item