a few more fixes and improvements
diff --git a/inc/qcbor/qcbor_decode.h b/inc/qcbor/qcbor_decode.h
index 12533e8..950b608 100644
--- a/inc/qcbor/qcbor_decode.h
+++ b/inc/qcbor/qcbor_decode.h
@@ -1037,7 +1037,7 @@
 
  When converting floating-point values, the integer is rounded to the nearest integer using
  llround(). By default, floating-point suport is enabled for QCBOR. If it is turned off,
- then floating-point conversion is not available.
+ then floating-point conversion is not available and TODO: error will be set.
  
  */
 static void QCBORDecode_GetInt64Convert(QCBORDecodeContext *pCtx, uint32_t uOptions, int64_t *pnValue);
@@ -1060,7 +1060,7 @@
  The additiona data item types that are suported are positive and negative bignums,
  decimal fractions and big floats, including decimal fractions and big floats that use bignums.
  Not that all these types can support numbers much larger that can be represented by
- in a 64-bit integer, so \ref QCBOR_ERR_CONVERSION_UNDER_OVER_FLOW will
+ in a 64-bit integer, so \ref QCBOR_ERR_CONVERSION_UNDER_OVER_FLOW may
  often be encountered.
 
  When converting bignums and decimal fractions \ref QCBOR_ERR_CONVERSION_UNDER_OVER_FLOW
@@ -1203,6 +1203,15 @@
 
 
 
+/**
+ @brief Decode the next item as a byte string
+
+ @param[in] pCtx   The decode context
+ @param[out] pBytes  The decoded byte string
+
+ On error, the decoder internal error state is set. If the next item
+ is not a byte string, the \ref QCBOR_ERR_UNEXPECTED_TYPE error is set.
+ */
 static void QCBORDecode_GetBytes(QCBORDecodeContext *pCtx, UsefulBufC *pBytes);
 
 static void QCBORDecode_GetBytesInMapN(QCBORDecodeContext *pCtx, int64_t nLabel, UsefulBufC *pBytes);
@@ -1710,7 +1719,9 @@
 
 // Semi private
 
-
+#define QCBOR_TAGSPEC_MATCH_TAG 0
+#define QCBOR_TAGSPEC_MATCH_TAG_CONTENT_TYPE 1 // When the tag type is known from the context of the protocol
+#define QCBOR_TAGSPEC_MATCH_EITHER 2 // CBOR protocols that need this are designed against recommended tag use !!
 typedef struct {
    uint8_t uTagRequirement;
    uint8_t uTaggedType;
@@ -1749,21 +1760,21 @@
 static inline void QCBORDecode_GetBytes(QCBORDecodeContext *pMe,  UsefulBufC *pValue)
 {
    // Complier should make this just 64-bit integer parameter
-   const TagSpecification TagSpec = {0, QCBOR_TYPE_BYTE_STRING, {QCBOR_TYPE_BYTE_STRING, 0,0,0,0,0}};
+   const TagSpecification TagSpec = {QCBOR_TAGSPEC_MATCH_TAG_CONTENT_TYPE, QCBOR_TYPE_BYTE_STRING, {QCBOR_TYPE_BYTE_STRING, 0,0,0,0,0}};
 
    QCBORDecode_GetTaggedStringInternal(pMe, TagSpec, pValue);
 }
 
 inline static void QCBORDecode_GetBytesInMapN(QCBORDecodeContext *pMe, int64_t nLabel, UsefulBufC *pBstr)
 {
-   const TagSpecification TagSpec = {0, QCBOR_TYPE_BYTE_STRING, {QCBOR_TYPE_BYTE_STRING, 0,0,0,0,0}};
+   const TagSpecification TagSpec = {QCBOR_TAGSPEC_MATCH_TAG_CONTENT_TYPE, QCBOR_TYPE_BYTE_STRING, {QCBOR_TYPE_BYTE_STRING, 0,0,0,0,0}};
 
    QCBORDecode_GetTaggedStringInMapN(pMe, nLabel, TagSpec, pBstr);
 }
 
 inline static void QCBORDecode_GetBytesInMapSZ(QCBORDecodeContext *pMe, const char *szLabel, UsefulBufC *pBstr)
 {
-   const TagSpecification TagSpec = {0, QCBOR_TYPE_BYTE_STRING, {QCBOR_TYPE_BYTE_STRING, 0,0,0,0,0}};
+   const TagSpecification TagSpec = {QCBOR_TAGSPEC_MATCH_TAG_CONTENT_TYPE, QCBOR_TYPE_BYTE_STRING, {QCBOR_TYPE_BYTE_STRING, 0,0,0,0,0}};
 
    QCBORDecode_GetTaggedStringInMapSZ(pMe, szLabel, TagSpec, pBstr);
 }
@@ -1785,7 +1796,7 @@
 inline static void QCBORDecode_GetTextInMapN(QCBORDecodeContext *pMe, int64_t nLabel, UsefulBufC *pText)
 {
    // This TagSpec only matches text strings; it also should optimize down to passing a 64-bit integer
-   const TagSpecification TagSpec = {0, QCBOR_TYPE_TEXT_STRING, {QCBOR_TYPE_TEXT_STRING, 0,0,0,0,0}};
+   const TagSpecification TagSpec = {QCBOR_TAGSPEC_MATCH_TAG_CONTENT_TYPE, QCBOR_TYPE_TEXT_STRING, {QCBOR_TYPE_TEXT_STRING, 0,0,0,0,0}};
 
    QCBORDecode_GetTaggedStringInMapN(pMe, nLabel, TagSpec, pText);
 }
@@ -1793,7 +1804,7 @@
 
 inline static void QCBORDecode_GetTextInMapSZ(QCBORDecodeContext *pMe, const char *szLabel, UsefulBufC *pText)
 {
-   const TagSpecification TagSpec = {0, QCBOR_TYPE_TEXT_STRING, {QCBOR_TYPE_TEXT_STRING, 0,0,0,0,0}};
+   const TagSpecification TagSpec = {QCBOR_TAGSPEC_MATCH_TAG_CONTENT_TYPE, QCBOR_TYPE_TEXT_STRING, {QCBOR_TYPE_TEXT_STRING, 0,0,0,0,0}};
 
    QCBORDecode_GetTaggedStringInMapSZ(pMe, szLabel, TagSpec, pText);
 }
diff --git a/src/qcbor_decode.c b/src/qcbor_decode.c
index 84db9e0..c832816 100644
--- a/src/qcbor_decode.c
+++ b/src/qcbor_decode.c
@@ -2192,46 +2192,56 @@
                                       uint8_t            uQcborType,
                                       QCBORItem         *pItem)
 {
-   QCBORItem One[2];
+   QCBORItem OneItemSeach[2];
 
-   One[0].uLabelType   = QCBOR_TYPE_TEXT_STRING;
-   One[0].label.string = UsefulBuf_FromSZ(szLabel);
-   One[0].uDataType    = uQcborType;
-   One[1].uLabelType   = QCBOR_TYPE_NONE; // Indicates end of array
+   OneItemSeach[0].uLabelType   = QCBOR_TYPE_TEXT_STRING;
+   OneItemSeach[0].label.string = UsefulBuf_FromSZ(szLabel);
+   OneItemSeach[0].uDataType    = uQcborType;
+   OneItemSeach[1].uLabelType   = QCBOR_TYPE_NONE; // Indicates end of array
 
-   QCBORError nReturn = MapSearch(pMe, One, NULL, NULL);
+   QCBORError nReturn = MapSearch(pMe, OneItemSeach, NULL, NULL);
    if(nReturn) {
      return nReturn;
    }
 
-   if(One[0].uDataType == QCBOR_TYPE_NONE) {
+   if(OneItemSeach[0].uDataType == QCBOR_TYPE_NONE) {
       return QCBOR_ERR_NOT_FOUND;
    }
 
-   *pItem = One[0];
+   *pItem = OneItemSeach[0];
 
    return QCBOR_SUCCESS;
 }
 
 
-static QCBORError CheckTagRequirement(TagSpecification TagSpec, uint8_t uDataType)
+static QCBORError CheckTagRequirement(const TagSpecification TagSpec, uint8_t uDataType)
 {
-   // This gets called a lot, so it needs to be fast, especially for simple cases.
-   // TODO: this isn't working right yet
-   if((TagSpec.uTagRequirement == 1 || TagSpec.uTagRequirement == 2) && uDataType == TagSpec.uTaggedType) {
-      return QCBOR_SUCCESS;
+   if(TagSpec.uTagRequirement == QCBOR_TAGSPEC_MATCH_TAG) {
+      /* Must match the tag */
+      if(uDataType == TagSpec.uTaggedType) {
+         return QCBOR_SUCCESS;
+      }
    } else {
-      for(int i = 0; i < 6; i++) {
+      /* QCBOR_TAGSPEC_MATCH_TAG_CONTENT_TYPE or QCBOR_TAGSPEC_MATCH_EITHER */
+      /* Must check all the possible types for the tag content */
+      for(size_t i = 0; i < sizeof(TagSpec.uAllowedContentTypes); i++) {
          if(uDataType == TagSpec.uAllowedContentTypes[i]) {
             return QCBOR_SUCCESS;
          }
       }
+      /* Didn't match any of the tag content types */
+      /* Check the tag for the either case */
+      if(TagSpec.uTagRequirement == QCBOR_TAGSPEC_MATCH_EITHER) {
+         if(uDataType == TagSpec.uTaggedType) {
+            return QCBOR_SUCCESS;
+         }
+      }
    }
 
    return QCBOR_ERR_UNEXPECTED_TYPE;
-
 }
 
+
 void QCBORDecode_GetTaggedItemInMapN(QCBORDecodeContext *pMe,
                                      int64_t             nLabel,
                                      TagSpecification    TagSpec,
@@ -2323,50 +2333,50 @@
 
 void QCBORDecode_EnterMapInMapN(QCBORDecodeContext *pMe, int64_t nLabel)
 {
-   QCBORItem One[2];
-   One[0].uLabelType  = QCBOR_TYPE_INT64;
-   One[0].label.int64 = nLabel;
-   One[0].uDataType   = QCBOR_TYPE_MAP;
-   One[1].uLabelType  = QCBOR_TYPE_NONE;
+   QCBORItem OneItemSeach[2];
+   OneItemSeach[0].uLabelType  = QCBOR_TYPE_INT64;
+   OneItemSeach[0].label.int64 = nLabel;
+   OneItemSeach[0].uDataType   = QCBOR_TYPE_MAP;
+   OneItemSeach[1].uLabelType  = QCBOR_TYPE_NONE;
 
    /* The map to enter was found, now finish of entering it. */
-   SearchAndEnter(pMe, One);
+   SearchAndEnter(pMe, OneItemSeach);
 }
 
 
 void QCBORDecode_EnterMapFromMapSZ(QCBORDecodeContext *pMe, const char  *szLabel)
 {
-   QCBORItem One[2];
-   One[0].uLabelType   = QCBOR_TYPE_TEXT_STRING;
-   One[0].label.string = UsefulBuf_FromSZ(szLabel);
-   One[0].uDataType    = QCBOR_TYPE_MAP;
-   One[1].uLabelType   = QCBOR_TYPE_NONE;
+   QCBORItem OneItemSeach[2];
+   OneItemSeach[0].uLabelType   = QCBOR_TYPE_TEXT_STRING;
+   OneItemSeach[0].label.string = UsefulBuf_FromSZ(szLabel);
+   OneItemSeach[0].uDataType    = QCBOR_TYPE_MAP;
+   OneItemSeach[1].uLabelType   = QCBOR_TYPE_NONE;
    
-   SearchAndEnter(pMe, One);
+   SearchAndEnter(pMe, OneItemSeach);
 }
 
 
 void QCBORDecode_EnterArrayFromMapN(QCBORDecodeContext *pMe, int64_t nLabel)
 {
-   QCBORItem One[2];
-   One[0].uLabelType  = QCBOR_TYPE_INT64;
-   One[0].label.int64 = nLabel;
-   One[0].uDataType   = QCBOR_TYPE_ARRAY;
-   One[1].uLabelType  = QCBOR_TYPE_NONE;
+   QCBORItem OneItemSeach[2];
+   OneItemSeach[0].uLabelType  = QCBOR_TYPE_INT64;
+   OneItemSeach[0].label.int64 = nLabel;
+   OneItemSeach[0].uDataType   = QCBOR_TYPE_ARRAY;
+   OneItemSeach[1].uLabelType  = QCBOR_TYPE_NONE;
 
-   SearchAndEnter(pMe, One);
+   SearchAndEnter(pMe, OneItemSeach);
 }
 
 
 void QCBORDecode_EnterArrayFromMapSZ(QCBORDecodeContext *pMe, const char  *szLabel)
 {
-   QCBORItem One[2];
-   One[0].uLabelType   = QCBOR_TYPE_TEXT_STRING;
-   One[0].label.string = UsefulBuf_FromSZ(szLabel);
-   One[0].uDataType    = QCBOR_TYPE_ARRAY;
-   One[1].uLabelType   = QCBOR_TYPE_NONE;
+   QCBORItem OneItemSeach[2];
+   OneItemSeach[0].uLabelType   = QCBOR_TYPE_TEXT_STRING;
+   OneItemSeach[0].label.string = UsefulBuf_FromSZ(szLabel);
+   OneItemSeach[0].uDataType    = QCBOR_TYPE_ARRAY;
+   OneItemSeach[1].uLabelType   = QCBOR_TYPE_NONE;
 
-   SearchAndEnter(pMe, One);
+   SearchAndEnter(pMe, OneItemSeach);
 }