diff --git a/dcmqrdb/libsrc/dcmqrdbi.cc b/dcmqrdb/libsrc/dcmqrdbi.cc
index 663c62d..f64a597 100644
--- a/dcmqrdb/libsrc/dcmqrdbi.cc
+++ b/dcmqrdb/libsrc/dcmqrdbi.cc
@@ -1670,7 +1670,7 @@ OFCondition DcmQueryRetrieveIndexDatabaseHandle::startFindRequest(
             /** If element is the Query Level, store it in handle
              */
 
-            if (elem. XTag == DCM_QueryRetrieveLevel) {
+            if (elem.XTag == DCM_QueryRetrieveLevel && elem.PValueField) {
                 char *pc ;
                 char level [50] ;
 
@@ -2268,7 +2268,7 @@ OFCondition DcmQueryRetrieveIndexDatabaseHandle::startMoveRequest(
             /** If element is the Query Level, store it in handle
              */
 
-            if (elem. XTag == DCM_QueryRetrieveLevel) {
+            if (elem. XTag == DCM_QueryRetrieveLevel && elem.PValueField) {
                 char *pc ;
                 char level [50] ;
 
@@ -2316,7 +2316,7 @@ OFCondition DcmQueryRetrieveIndexDatabaseHandle::startMoveRequest(
                 DB_DuplicateElement (&elem, & (plist->elem)) ;
                 if (handle_->findRequestList == NULL) {
                     handle_->findRequestList = last = plist ;
-                } else {
+                } else if (last) {
                     last->next = plist ;
                     last = plist ;
                 }
diff --git a/dcmsign/libsrc/dcsignat.cc b/dcmsign/libsrc/dcsignat.cc
index 6f1f95e..6fdeb68 100644
--- a/dcmsign/libsrc/dcsignat.cc
+++ b/dcmsign/libsrc/dcsignat.cc
@@ -195,7 +195,7 @@ OFCondition DcmSignature::removeSignature(unsigned long i)
     signatureSq = NULL;
   }
 
-  if (macParametersSq->card() == 0) 
+  if (macParametersSq && macParametersSq->card() == 0) 
   {
     delete currentItem->remove(macParametersSq);
     macParametersSq = NULL;
