fix switched protection order in qap_decode (closes #16)