Fix for single/multi query functionality