Fixed canonical query test and mqfilter.c bugs