Bugfixes in QC test