More improvements to the async query pipeline.

If I remember correctly this cast is not necessary.