Index: epdom.c
===================================================================
--- epdom.c	(revision 478478)
+++ epdom.c	(working copy)
@@ -4194,11 +4195,11 @@
 
     if (pAttr)
 	{
-	pAttr -> bFlags = 0 ;
 	if (pAttr -> xName)
 	    NdxStringFree (a, pAttr -> xName) ;
 	if (pAttr -> xValue && (pAttr -> bFlags & aflgAttrValue))
 	    NdxStringFree (a, pAttr -> xValue) ;
+	pAttr -> bFlags = 0 ;
 	}
 
     /*
@@ -4299,7 +4300,7 @@
 
     ASSERT_ATTR_VALID(a,pAttr) ;
       
-      if (!pAttr)
+      if (!pAttr || pAttr -> bFlags == aflgDeleted)
 	return NULL ;
 /* lprintf (a, "selvalue 1 f=%x a=%x aa=%x an=%d off=%d av=%d\n", pAttr -> bFlags , aflgAttrChilds, pAttr, pAttr -> xNdx, pAttr -> nNodeOffset, pAttr -> xValue) ; */
 
