QSP fixes, tests refactor, small API changes