diff --git a/src/Encrypt.c b/src/Encrypt.c
index 022fcc1..221c870 100644
--- a/src/Encrypt.c
+++ b/src/Encrypt.c
@@ -962,6 +962,7 @@
 
 	pRecip->m_recipientNext = pEncrypt->m_recipientFirst;
 	pEncrypt->m_recipientFirst = pRecip;
+	pRecip->m_encrypt.m_message.m_refCount++;
 
 	pRecipients = _COSE_arrayget_int(&pEncrypt->m_message, INDEX_RECIPIENTS);
 	if (pRecipients == NULL) {
@@ -983,7 +984,6 @@
 							 pRecip->m_encrypt.m_message.m_cbor, &cbor_error),
 		cbor_error);
 
-	pRecip->m_encrypt.m_message.m_refCount++;
 
 	return true;
 
diff --git a/test/encrypt.c b/test/encrypt.c
index a776183..c81aac7 100644
--- a/test/encrypt.c
+++ b/test/encrypt.c
@@ -545,6 +545,7 @@
 		}
 
 		if (!COSE_Enveloped_AddRecipient(hEncObj, hRecip, NULL)) {
+			COSE_Recipient_Free(hRecip);
 			goto returnError;
 		}
 
@@ -573,15 +574,18 @@
 
 			if (!SetSendingAttributes((HCOSE)hCountersign, countersign,
 					Attributes_Countersign_protected)) {
+				COSE_CounterSign_Free(hCountersign);
 				goto returnError;
 			}
 
 			if (!COSE_CounterSign_SetKey(hCountersign, pkeyCountersign, NULL)) {
+				COSE_CounterSign_Free(hCountersign);
 				goto returnError;
 			}
 
 			if (!COSE_Enveloped_add_countersignature(
 					hEncObj, hCountersign, NULL)) {
+				COSE_CounterSign_Free(hCountersign);
 				goto returnError;
 			}
 
@@ -606,6 +610,10 @@
 	return f;
 
 returnError:
+	if (hEncObj != NULL) {
+		COSE_Enveloped_Free(hEncObj);
+	}
+	
 	CFails += 1;
 	return 0;
 }
@@ -748,7 +756,7 @@
 	const cn_cbor *pFail;
 	const cn_cbor *pEncrypt;
 	const cn_cbor *pRecipients;
-	HCOSE_ENCRYPT hEnc;
+	HCOSE_ENCRYPT hEnc = NULL;
 	int type;
 	bool fFail = false;
 	bool fFailBody = false;
@@ -922,9 +930,11 @@
 	}
 #endif
 
-	COSE_Encrypt_Free(hEnc);
 
 exitHere:
+	if (hEnc != NULL) {
+		COSE_Encrypt_Free(hEnc);
+	}
 
 	if (fAlgSupport) {
 		if (fFailBody) {
@@ -946,6 +956,10 @@
 	return fAlgSupport ? 1 : 0;
 
 returnError:
+	if (hEnc != NULL) {
+		COSE_Encrypt_Free(hEnc);
+	}
+
 	CFails += 1;
 	return 0;
 }
@@ -1043,15 +1057,18 @@
 
 			if (!SetSendingAttributes((HCOSE)hCountersign, countersign,
 					Attributes_Countersign_protected)) {
+				COSE_CounterSign_Free(hCountersign);
 				goto returnError;
 			}
 
 			if (!COSE_CounterSign_SetKey(hCountersign, pkeyCountersign, NULL)) {
+				COSE_CounterSign_Free(hCountersign);
 				goto returnError;
 			}
 
 			if (!COSE_Encrypt0_add_countersignature(
 					hEncObj, hCountersign, NULL)) {
+				COSE_CounterSign_Free(hCountersign);
 				goto returnError;
 			}
 
@@ -1076,6 +1093,10 @@
 	return f;
 
 returnError:
+	if (hEncObj != NULL) {
+		COSE_Encrypt_Free(hEncObj);
+	}
+	
 	CFails += 1;
 	return 1;
 }
diff --git a/test/mac_test.c b/test/mac_test.c
index 2fd1181..1bd82d6 100644
--- a/test/mac_test.c
+++ b/test/mac_test.c
@@ -316,7 +316,8 @@
 int BuildMacMessage(const cn_cbor *pControl)
 {
 	int iRecipient = 0;
-
+	HCOSE_RECIPIENT hRecip = NULL;
+	
 	//
 	//  We don't run this for all control sequences - skip those marked fail.
 	//
@@ -361,8 +362,7 @@
 			goto returnError;
 		}
 
-		HCOSE_RECIPIENT hRecip =
-			COSE_Recipient_Init(0, CBOR_CONTEXT_PARAM_COMMA NULL);
+		hRecip = COSE_Recipient_Init(0, CBOR_CONTEXT_PARAM_COMMA NULL);
 		if (hRecip == NULL) {
 			goto returnError;
 		}
@@ -431,6 +431,7 @@
 #endif
 
 		COSE_Recipient_Free(hRecip);
+		hRecip = NULL;
 	}
 
 #if INCLUDE_COUNTERSIGNATURE
@@ -455,14 +456,17 @@
 
 			if (!SetSendingAttributes((HCOSE)hCountersign, countersign,
 					Attributes_Countersign_protected)) {
+				COSE_CounterSign_Free(hCountersign);
 				goto returnError;
 			}
 
 			if (!COSE_CounterSign_SetKey(hCountersign, pkeyCountersign, NULL)) {
+				COSE_CounterSign_Free(hCountersign);
 				goto returnError;
 			}
 
 			if (!COSE_Mac_add_countersignature(hMacObj, hCountersign, NULL)) {
+				COSE_CounterSign_Free(hCountersign);
 				goto returnError;
 			}
 
@@ -488,6 +492,12 @@
 	return f;
 
 returnError:
+	if (hMacObj != NULL) {
+		COSE_Mac_Free(hMacObj);
+	}
+	if (hRecip != NULL) {
+		COSE_Recipient_Free(hRecip);
+	}
 	CFails += 1;
 	return 1;
 }
@@ -761,7 +771,6 @@
 	}
 #endif
 
-	COSE_Mac0_Free(hMAC);
 
 	if (fFailBody) {
 		if (!fFail) {
@@ -771,13 +780,21 @@
 			fFail = false;
 		}
 	}
+	
 exitHere:
+	if (hMAC != NULL) {
+		COSE_Mac0_Free(hMAC);
+	}
+	
 	if (fFail) {
 		CFails += 1;
 	}
 	return fUnsuportedAlg ? 0 : 1;
 
 errorReturn:
+	if (hMAC != NULL) {
+		COSE_Mac0_Free(hMAC);
+	}
 	CFails += 1;
 	return (fFail || fUnsuportedAlg) ? 0 : 1;
 }
@@ -859,14 +876,17 @@
 
 			if (!SetSendingAttributes((HCOSE)hCountersign, countersign,
 					Attributes_Countersign_protected)) {
+				COSE_CounterSign_Free(hCountersign);
 				goto returnError;
 			}
 
 			if (!COSE_CounterSign_SetKey(hCountersign, pkeyCountersign, NULL)) {
+				COSE_CounterSign_Free(hCountersign);
 				goto returnError;
 			}
 
 			if (!COSE_Mac0_add_countersignature(hMacObj, hCountersign, NULL)) {
+				COSE_CounterSign_Free(hCountersign);
 				goto returnError;
 			}
 
@@ -892,6 +912,7 @@
 	return f;
 
 returnError:
+	COSE_Mac0_Free(hMacObj);
 	CFails += 1;
 	return 1;
 }
diff --git a/test/sign.c b/test/sign.c
index 870adc1..f6ac539 100644
--- a/test/sign.c
+++ b/test/sign.c
@@ -31,12 +31,14 @@
 	const cn_cbor *pFail;
 	const cn_cbor *pSign;
 	const cn_cbor *pSigners;
-	HCOSE_SIGN hSig;
+	HCOSE_SIGN hSig = NULL;
+	HCOSE_SIGNER hSigner = NULL;
 	int type;
 	int iSigner;
 	bool fFail = false;
 	bool fFailBody = false;
 	bool fNoSupportAlg = false;
+	HCOSE_COUNTERSIGN h = NULL;
 
 	pFail = cn_cbor_mapget_string(pControl, "fail");
 	if ((pFail != NULL) && (pFail->type == CN_CBOR_TRUE)) {
@@ -76,14 +78,12 @@
 
 		cn_cbor *pkey = BuildKey(cn_cbor_mapget_string(pSigners, "key"), false);
 		if (pkey == NULL) {
-			fFail = true;
-			continue;
+			goto returnError;
 		}
 
 		HCOSE_SIGNER hSigner = COSE_Sign_GetSigner(hSig, iSigner, NULL);
 		if (hSigner == NULL) {
-			fFail = true;
-			continue;
+			goto returnError;
 		}
 		if (!SetReceivingAttributes(
 				(HCOSE)hSigner, pSigners, Attributes_Signer_protected)) {
@@ -91,8 +91,7 @@
 		}
 
 		if (!COSE_Signer_SetKey(hSigner, pkey, NULL)) {
-			fFail = true;
-			continue;
+			goto returnError;
 		}
 
 		cn_cbor *alg = COSE_Signer_map_get_int(
@@ -142,8 +141,7 @@
 			for (int counterNo = 0; counterNo < count; counterNo++) {
 				bool noSignAlg = false;
 
-				HCOSE_COUNTERSIGN h =
-					COSE_Signer_get_countersignature(hSigner, counterNo, 0);
+				h =	COSE_Signer_get_countersignature(hSigner, counterNo, 0);
 				if (h == NULL) {
 					fFail = true;
 					continue;
@@ -288,6 +286,13 @@
 	return fNoSupportAlg ? 0 : 1;
 
 returnError:
+	if (hSigner != NULL) {
+		COSE_Signer_Free(hSigner);
+	}
+	if (hSig != NULL) {
+		COSE_Sign_Free(hSig);
+	}
+	
 	CFails += 1;
 	return 0;
 }
@@ -303,7 +308,8 @@
 int BuildSignedMessage(const cn_cbor *pControl)
 {
 	int iSigner;
-
+	HCOSE_SIGNER hSigner = NULL;
+	
 	//
 	//  We don't run this for all control sequences - skip those marked fail.
 	//
@@ -347,7 +353,7 @@
 			goto returnError;
 		}
 
-		HCOSE_SIGNER hSigner = COSE_Signer_Init(CBOR_CONTEXT_PARAM_COMMA NULL);
+		hSigner = COSE_Signer_Init(CBOR_CONTEXT_PARAM_COMMA NULL);
 		if (hSigner == NULL) {
 			goto returnError;
 		}
@@ -387,16 +393,19 @@
 
 				if (!SetSendingAttributes((HCOSE)hCountersign, countersign,
 						Attributes_Countersign_protected)) {
+					COSE_CounterSign_Free(hCountersign);
 					goto returnError;
 				}
 
 				if (!COSE_CounterSign_SetKey(
 						hCountersign, pkeyCountersign, NULL)) {
+					COSE_CounterSign_Free(hCountersign);
 					goto returnError;
 				}
 
 				if (!COSE_Signer_add_countersignature(
 						hSigner, hCountersign, NULL)) {
+					COSE_CounterSign_Free(hCountersign);
 					goto returnError;
 				}
 
@@ -428,14 +437,17 @@
 
 			if (!SetSendingAttributes((HCOSE)hCountersign, countersign,
 					Attributes_Countersign_protected)) {
+				COSE_CounterSign_Free(hCountersign);
 				goto returnError;
 			}
 
 			if (!COSE_CounterSign_SetKey(hCountersign, pkeyCountersign, NULL)) {
+				COSE_CounterSign_Free(hCountersign);
 				goto returnError;
 			}
 
 			if (!COSE_Sign_add_countersignature(hSignObj, hCountersign, NULL)) {
+				COSE_CounterSign_Free(hCountersign);
 				goto returnError;
 			}
 
@@ -461,6 +473,13 @@
 	return f;
 
 returnError:
+	if (hSignObj != NULL) {
+		COSE_Sign_Free(hSignObj);
+	}
+	if (hSigner != NULL) {
+		COSE_Signer_Free(hSigner);
+	}
+	
 	CFails += 1;
 	return 1;
 }
@@ -710,7 +729,6 @@
 	}
 #endif
 
-	COSE_Sign1_Free(hSig);
 
 	if (fFailBody) {
 		if (!fFail) {
@@ -722,6 +740,9 @@
 	}
 
 exitHere:
+	if (hSig != NULL) {
+		COSE_Sign1_Free(hSig);
+	}
 
 	if (fFail) {
 		CFails += 1;
@@ -729,6 +750,10 @@
 	return fNoAlgSupport ? 0 : 1;
 
 returnError:
+	if (hSig != NULL) {
+		COSE_Sign1_Free(hSig);
+	}
+
 	CFails += 1;
 	return 0;
 }
@@ -801,15 +826,18 @@
 
 			if (!SetSendingAttributes((HCOSE)hCountersign, countersign,
 					Attributes_Countersign_protected)) {
+				COSE_CounterSign_Free(hCountersign);
 				goto returnError;
 			}
 
 			if (!COSE_CounterSign_SetKey(hCountersign, pkeyCountersign, NULL)) {
+				COSE_CounterSign_Free(hCountersign);
 				goto returnError;
 			}
 
 			if (!COSE_Sign1_add_countersignature(
 					hSignObj, hCountersign, NULL)) {
+				COSE_CounterSign_Free(hCountersign);
 				goto returnError;
 			}
 
@@ -835,6 +863,9 @@
 	return f;
 
 returnError:
+	if (hSignObj != NULL) {
+		COSE_Sign1_Free(hSignObj);
+	}
 	CFails += 1;
 	return 1;
 }
diff --git a/test/test.c b/test/test.c
index 1af4a38..6a794ef 100644
--- a/test/test.c
+++ b/test/test.c
@@ -953,6 +953,12 @@
 				if (IsContextEmpty(context) != 0) {
 					CFails += 1;
 				}
+#ifndef NDEBUG
+				if (!AreListsEmpty()) {
+					CFails += 1;
+					break;
+				}
+#endif
 				FreeContext(context);
 			}
 
@@ -966,6 +972,12 @@
 				if (IsContextEmpty(context) != 0) {
 					CFails += 1;
 				}
+#ifndef NDEBUG
+				if (!AreListsEmpty()) {
+					CFails += 1;
+					break;
+				}
+#endif
 				FreeContext(context);
 			}
 #else
@@ -985,6 +997,12 @@
 				if (IsContextEmpty(context) != 0) {
 					CFails += 1;
 				}
+#ifndef NDEBUG
+				if (!AreListsEmpty()) {
+					CFails += 1;
+					break;
+				}
+#endif
 				FreeContext(context);
 			}
 
@@ -998,6 +1016,12 @@
 				if (IsContextEmpty(context) != 0) {
 					CFails += 1;
 				}
+#ifndef NDEBUG
+				if (!AreListsEmpty()) {
+					CFails += 1;
+					break;
+				}
+#endif
 				FreeContext(context);
 			}
 #else
@@ -1017,6 +1041,12 @@
 				if (IsContextEmpty(context) != 0) {
 					CFails += 1;
 				}
+#ifndef NDEBUG
+				if (!AreListsEmpty()) {
+					CFails += 1;
+					break;
+				}
+#endif
 				FreeContext(context);
 			}
 
@@ -1030,6 +1060,12 @@
 				if (IsContextEmpty(context) != 0) {
 					CFails += 1;
 				}
+#ifndef NDEBUG
+				if (!AreListsEmpty()) {
+					CFails += 1;
+					break;
+				}
+#endif
 				FreeContext(context);
 			}
 #else
@@ -1049,6 +1085,12 @@
 				if (IsContextEmpty(context) != 0) {
 					CFails += 1;
 				}
+#ifndef NDEBUG
+				if (!AreListsEmpty()) {
+					CFails += 1;
+					break;
+				}
+#endif
 				FreeContext(context);
 			}
 
@@ -1062,6 +1104,12 @@
 				if (IsContextEmpty(context) != 0) {
 					CFails += 1;
 				}
+#ifndef NDEBUG
+				if (!AreListsEmpty()) {
+					CFails += 1;
+					break;
+				}
+#endif
 				FreeContext(context);
 			}
 #else
@@ -1081,6 +1129,12 @@
 				if (IsContextEmpty(context) != 0) {
 					CFails += 1;
 				}
+#ifndef NDEBUG
+				if (!AreListsEmpty()) {
+					CFails += 1;
+					break;
+				}
+#endif
 				FreeContext(context);
 			}
 
@@ -1094,6 +1148,12 @@
 				if (IsContextEmpty(context) != 0) {
 					CFails += 1;
 				}
+#ifndef NDEBUG
+				if (!AreListsEmpty()) {
+					CFails += 1;
+					break;
+				}
+#endif
 				FreeContext(context);
 			}
 #else
@@ -1101,8 +1161,8 @@
 			fBuildDone = true;
 #endif
 		}
+		CFails = 0;
 	}
-	CFails = 0;
 	context = NULL;
 #else
 	return;
