Do a better job of removing modules, and allow adding duplicate modules.
Do a better job of removing modules, and allow adding duplicate modules.

--- a/EVAManager.cs
+++ b/EVAManager.cs
@@ -86,7 +86,7 @@
 					AvailablePart loadedPart;
 					for (int idx = 0; idx < PartLoader.LoadedPartsList.Count; idx++)
 					{
-						loadedPart = PartLoader.LoadedPartsList[operatorIdx];
+						loadedPart = PartLoader.LoadedPartsList[idx];
 						string lowerName = loadedPart.name.ToLower();
 
 						if (lowerName == "kerbaleva" || lowerName == "kerbalevafemale")
@@ -304,11 +304,11 @@
 
 			if (evaModuleNode.TryGetValue("name", out moduleName))
 			{
-				if (evaPart.GetComponents<PartModule>().Any(m => m.GetType().Name == moduleName))
-				{
-					this.LogWarning("Skipping module {1}: already present in kerbalEVA", moduleName);
+				/*if (evaPart.GetComponents<PartModule>().Any(m => m.GetType().Name == moduleName))
+				{
+					this.LogWarning("Skipping module {0}: already present in kerbalEVA", moduleName);
 					return;
-				}
+				}*/
 
 				Type moduleClass = AssemblyLoader.GetClassByName(typeof(PartModule), moduleName);
 
@@ -334,7 +334,8 @@
 				}
 				catch (Exception ex)
 				{
-					this.LogError("Handled exception {0} while adding modules to kerbalEVA.", ex.GetType().Name);
+					this.LogError("Handled exception {0} while adding modules to {1}.",
+						ex.GetType().Name, evaPart);
 
 					#if DEBUG
 					Debug.LogException(ex);
@@ -343,11 +344,11 @@
 
 				if (evaPart.GetComponents<PartModule>().Any(m => m.GetType().Name == moduleName))
 				{
-					this.Log("Added module {0} to kerbalEVA part.",	moduleName);
+					this.Log("Added module {0} to {1}.", moduleName, evaPart);
 				}
 				else
 				{
-					this.LogWarning("Failed to add {0} to kerbalEVA part.", moduleName);
+					this.LogWarning("Failed to add {0} to {1}.", moduleName, evaPart);
 				}
 			}
 			else
@@ -393,7 +394,7 @@
 				resource.SetInfo(resourceInfo);
 				((EVAPartResource)resource).Load(evaResourceNode);
 
-				this.Log("Added resource {0} to kerbalEVA part.", resource.resourceName);
+				this.Log("Added resource {0} to {1}", resource.resourceName, evaPart);
 
 				this.LogDebug("Resource '{0}' loaded.", resourceName);
 			}
@@ -410,7 +411,10 @@
 
 			if (module != null)
 			{
-				GameObject.Destroy(module);
+				evaPart.Modules.Remove(module);
+				GameObject.DestroyImmediate(module);
+
+				this.Log("Removed module {0} from {1} and marked for destruction.", matchName, evaPart);
 			}
 		}
 
@@ -420,12 +424,10 @@
 
 			if (resource != null)
 			{
+				evaPart.Resources.list.Remove(resource);
 				GameObject.Destroy(resource);
 
-				Tools.PostDebugMessage(
-					this,
-					"EVA resource {0} marked for destruction.",
-					resource.resourceName);
+				this.Log("Removed resource {0} from {1} and marked for destruction.", matchName, evaPart);
 			}
 		}