diff --git a/indra/llcommon/llinitparam.h b/indra/llcommon/llinitparam.h
index a3a5b3dc372f6c376a85d7cc82b6b0933df26b73..9530e562f6d300c071cd8c34f9fb2ab1dc65ac33 100644
--- a/indra/llcommon/llinitparam.h
+++ b/indra/llcommon/llinitparam.h
@@ -916,7 +916,6 @@ namespace LLInitParam
 			{
 				predicate.add(NON_DEFAULT);
 			}
-			predicate.unknown(REQUIRED);
 			if (typed_param.isValid())
 			{
 				predicate.add(VALID);
@@ -1074,8 +1073,6 @@ namespace LLInitParam
 			const self_t& typed_param = static_cast<const self_t&>(param);
 
 			LLPredicate::Value<ESerializePredicates> predicate;
-			predicate.unknown(NON_DEFAULT);
-			predicate.unknown(REQUIRED);
 
 			if (typed_param.isValid())
 			{
@@ -1272,16 +1269,11 @@ namespace LLInitParam
 			const self_t& typed_param = static_cast<const self_t&>(param);
 			
 			LLPredicate::Value<ESerializePredicates> predicate;
-			predicate.unknown(NON_DEFAULT);
 
 			if (typed_param.mMinCount > 0)
 			{
 				predicate.add(REQUIRED);
 			}
-			else
-			{
-				predicate.unknown(REQUIRED);
-			}
 
 			if (typed_param.isValid())
 			{
@@ -1538,16 +1530,11 @@ namespace LLInitParam
 			const self_t& typed_param = static_cast<const self_t&>(param);
 
 			LLPredicate::Value<ESerializePredicates> predicate;
-			predicate.unknown(NON_DEFAULT);
 
 			if (typed_param.mMinCount > 0)
 			{
 				predicate.add(REQUIRED);
 			}
-			else
-			{
-				predicate.unknown(REQUIRED);
-			}
 
 			if (typed_param.isValid())
 			{
diff --git a/indra/llui/llxuiparser.cpp b/indra/llui/llxuiparser.cpp
index 179a1184af0c1c53fe7b70641c603ee37c5bd9e9..95cda92632947b64319cdecb0882aaa29c411f0b 100644
--- a/indra/llui/llxuiparser.cpp
+++ b/indra/llui/llxuiparser.cpp
@@ -880,16 +880,24 @@ LLXMLNodePtr LLXUIParser::getNode(name_stack_t& stack)
 		it = next_it)
 	{
 		++next_it;
+		bool force_new_node = false;
+
 		if (it->first.empty())
 		{
 			it->second = false;
 			continue;
 		}
 
+		if (next_it != stack.end() && next_it->first.empty() && next_it->second)
+		{
+			force_new_node = true;
+		}
+
+
 		out_nodes_t::iterator found_it = mOutNodes.find(it->first);
 
 		// node with this name not yet written
-		if (found_it == mOutNodes.end() || it->second)
+		if (found_it == mOutNodes.end() || it->second || force_new_node)
 		{
 			// make an attribute if we are the last element on the name stack
 			bool is_attribute = next_it == stack.end();
diff --git a/indra/llxml/llxmlnode.cpp b/indra/llxml/llxmlnode.cpp
index 2ffb0d8503cd662c106704c3f53d781a7ee55261..8746114f1b989c5433a10ff671a254a2cb6e7806 100644
--- a/indra/llxml/llxmlnode.cpp
+++ b/indra/llxml/llxmlnode.cpp
@@ -273,7 +273,8 @@ void LLXMLNode::addChild(LLXMLNodePtr new_child, LLXMLNodePtr after_child)
 	new_child->mParent = this;
 	if (new_child->mIsAttribute)
 	{
-		mAttributes.insert(std::make_pair(new_child->mName, new_child));
+		std::pair<LLXMLAttribList::iterator, bool> result = mAttributes.insert(std::make_pair(new_child->mName, new_child));
+		llassert(result.second);
 	}
 	else
 	{