Added network matching, Fixed case-folding for query lookup