Fix warning handler in query engine