Fix multple query includes

Hi Andy
A small fix for the multiple query feature, code change should be self explanatory.