More efficient iteration in QSP (better use of STD API)
QSP - transfering fix from GAL repo and small refactor