Cleaning up logic so that all queries are case-insensitive by default, unless otherwise specified in the configuration.