Finished debugging of changes needed for QC