QSV: fix some stupid bugs