Fixed issue with duplicate qid's.