Fix to test name exclude logic in soql query