Error checking and more robust ams qc import