Made lookups case insensitive, and fixed bug in query.