Index: /branches/advancedMidiLearn/libs/hydrogen/src/preferences.cpp
===================================================================
--- /branches/advancedMidiLearn/libs/hydrogen/src/preferences.cpp	(revision 1498)
+++ /branches/advancedMidiLearn/libs/hydrogen/src/preferences.cpp	(revision 1592)
@@ -644,9 +644,9 @@
 				
 				while ( !pMidiEventNode.isNull() ) {
-					
-					if( pMidiEventNode.firstChildElement().nodeValue() == QString("mmcEvent")){
-						QString event = pMidiEventNode.firstChildElement("mmcEvent").firstChildElement().nodeValue();
-						QString s_action = pMidiEventNode.firstChildElement("action").firstChildElement().nodeValue();
-						QString s_param = pMidiEventNode.firstChildElement("parameter").firstChildElement().nodeValue();
+					if( pMidiEventNode.firstChildElement().nodeName() == QString("mmcEvent")){
+						QString event = pMidiEventNode.firstChildElement("mmcEvent").text();
+						QString s_action = pMidiEventNode.firstChildElement("action").text();
+						QString s_param = pMidiEventNode.firstChildElement("parameter").text();
+
 						Action* pAction = new Action( s_action );
 						pAction->setParameter1( s_param );
@@ -654,9 +654,9 @@
 					}
 
-					if( pMidiEventNode.firstChildElement().nodeValue() == QString("noteEvent")){
-						QString event = pMidiEventNode.firstChildElement("noteEvent").firstChildElement().nodeValue();
-						QString s_action = pMidiEventNode.firstChildElement("action").firstChildElement().nodeValue();
-						QString s_param = pMidiEventNode.firstChildElement("parameter").firstChildElement().nodeValue();
-						QString s_eventParameter = pMidiEventNode.firstChildElement("eventParameter").firstChildElement().nodeValue();
+					if( pMidiEventNode.firstChildElement().nodeName() == QString("noteEvent")){
+						QString event = pMidiEventNode.firstChildElement("noteEvent").text();
+						QString s_action = pMidiEventNode.firstChildElement("action").text();
+						QString s_param = pMidiEventNode.firstChildElement("parameter").text();
+						QString s_eventParameter = pMidiEventNode.firstChildElement("eventParameter").text();
 						Action* pAction = new Action( s_action );
 						pAction->setParameter1( s_param );
@@ -664,9 +664,9 @@
 					}
 
-					if( pMidiEventNode.firstChildElement().nodeValue() == QString("ccEvent") ){
-						QString event = pMidiEventNode.firstChildElement("ccEvent").firstChildElement().nodeValue();
-						QString s_action = pMidiEventNode.firstChildElement("action").firstChildElement().nodeValue();
-						QString s_param = pMidiEventNode.firstChildElement("parameter").firstChildElement().nodeValue();
-						QString s_eventParameter = pMidiEventNode.firstChildElement("eventParameter").firstChildElement().nodeValue();
+					if( pMidiEventNode.firstChildElement().nodeName() == QString("ccEvent") ){
+						QString event = pMidiEventNode.firstChildElement("ccEvent").text();
+						QString s_action = pMidiEventNode.firstChildElement("action").text();
+						QString s_param = pMidiEventNode.firstChildElement("parameter").text();
+						QString s_eventParameter = pMidiEventNode.firstChildElement("eventParameter").text();
 						Action * pAction = new Action( s_action );
 						pAction->setParameter1( s_param );
Index: /branches/advancedMidiLearn/libs/hydrogen/src/midiMap.cpp
===================================================================
--- /branches/advancedMidiLearn/libs/hydrogen/src/midiMap.cpp	(revision 1266)
+++ /branches/advancedMidiLearn/libs/hydrogen/src/midiMap.cpp	(revision 1592)
@@ -100,4 +100,7 @@
 {
 	QMutexLocker mx(&__mutex);
+	if( mmcMap[ eventString ] != NULL){
+	    delete mmcMap[ eventString ];
+	}
 	mmcMap[ eventString ] = pAction;
 }
