Minor corrections
diff --git a/inc/qcbor/qcbor_decode.h b/inc/qcbor/qcbor_decode.h
index a6c3ee6..be08069 100644
--- a/inc/qcbor/qcbor_decode.h
+++ b/inc/qcbor/qcbor_decode.h
@@ -1096,9 +1096,9 @@
  *
  * @returns Error code possibly indicating end of input.
  *
- * This returns the same as QCBORDecode_GetError() except that @ref
- * QCBOR_ERR_NO_MORE_ITEMS is returned if the travseral cursor is at
- * the end of the input.
+ * This returns the same as QCBORDecode_GetError() except that
+ * @ref QCBOR_ERR_NO_MORE_ITEMS is returned if the travseral cursor
+ * is at the end of the input.
  */
 QCBORError
 QCBORDecode_EndCheck(QCBORDecodeContext *pCtx);
diff --git a/src/qcbor_decode.c b/src/qcbor_decode.c
index 4872ced..1fa8a38 100644
--- a/src/qcbor_decode.c
+++ b/src/qcbor_decode.c
@@ -3164,10 +3164,12 @@
 QCBORError
 QCBORDecode_EndCheck(QCBORDecodeContext *pMe)
 {
-   size_t uCursorOffset;
+   size_t     uCursorOffset;
+   QCBORError uErr;
 
-   if(pMe->uLastError != QCBOR_SUCCESS) {
-      return pMe->uLastError;
+   uErr = QCBORDecode_GetError(pMe);
+   if(uErr != QCBOR_SUCCESS) {
+      return uErr;
    }
 
    uCursorOffset = UsefulInputBuf_Tell(&(pMe->InBuf));