Fix query_exec call