Make sure qid is of an integer type