Add missing method on Constraint
Fix case when qid is str