Correctly use semantic parent in qid

Fixes #53