Additional QoQ Fix

Add the same check into queryToStruct that was used in queryToArray