QC bug fixes: #34, #51