Fixed query.c