Let qparent and qapplied work for detached HEAD
Merge pull request #8 from aknow/fix_qapplied

Let qparent and qapplied work for detached HEAD