Index: code/fred2/wing_editor.cpp
===================================================================
--- code/fred2/wing_editor.cpp	(revision 4926)
+++ code/fred2/wing_editor.cpp	(working copy)
@@ -1007,26 +1007,26 @@
 
 	if (m_threshold >= Wings[cur_wing].wave_count) {
 		m_threshold = Wings[cur_wing].wave_count - 1;
-		if (!bypass_errors)
+		if (!bypass_errors) {
 			sprintf(buf, "Wave threshold is set too high.  Value has been lowered to %d", (int) m_threshold);
-
-		MessageBox(buf);
+			MessageBox(buf);
+		}
 	}
 
 	if (m_threshold + Wings[cur_wing].wave_count > MAX_SHIPS_PER_WING) {
 		m_threshold = MAX_SHIPS_PER_WING - Wings[cur_wing].wave_count;
-		if (!bypass_errors)
+		if (!bypass_errors) {
 			sprintf(buf, "Wave threshold is set too high.  Value has been lowered to %d", (int) m_threshold);
-
-		MessageBox(buf);
+			MessageBox(buf);
+		}
 	}
 
 	if (m_waves < 1) {
 		m_waves = 1;
-		if (!bypass_errors)
+		if (!bypass_errors) {
 			sprintf(buf, "Number of waves illegal.  Has been set to 1.", (int) m_waves);
-
-		MessageBox(buf);
+			MessageBox(buf);
+		}
 	}
 
 	MODIFY(Wings[cur_wing].special_ship, m_special_ship);
@@ -1036,10 +1036,11 @@
 	MODIFY(Wings[cur_wing].departure_location, m_departure_location);
 	MODIFY(Wings[cur_wing].arrival_delay, m_arrival_delay);
 	if (m_arrival_delay_min > m_arrival_delay_max) {
-		if (!bypass_errors)
+		if (!bypass_errors) {
 			sprintf(buf, "Arrival delay minimum greater than maximum.  Value lowered to %d", m_arrival_delay_max);
+			MessageBox(buf);
+		}
 
-		MessageBox(buf);
 		m_arrival_delay_min = m_arrival_delay_max;
 	}
 
@@ -1054,12 +1055,14 @@
 		if (((m_arrival_location != ARRIVE_AT_LOCATION) && (m_arrival_location != ARRIVE_FROM_DOCK_BAY)) && (i >= 0) && !(i & SPECIAL_ARRIVAL_ANCHOR_FLAG)) {
 			d = int(min(500, 2.0f * Objects[Ships[i].objnum].radius));
 			if ((Wings[cur_wing].arrival_distance < d) && (Wings[cur_wing].arrival_distance > -d)) {
-				if (!bypass_errors)
+				if (!bypass_errors) {
 					sprintf(buf, "Ship must arrive at least %d meters away from target.\n"
 						"Value has been reset to this.  Use with caution!\r\n"
 						"Reccomended distance is %d meters.\r\n", d, (int)(2.0f * Objects[Ships[i].objnum].radius) );
 
-				MessageBox(buf);
+					MessageBox(buf);
+				}
+
 				if (Wings[cur_wing].arrival_distance < 0)
 					Wings[cur_wing].arrival_distance = -d;
 				else
Index: code/fred2/wing.cpp
===================================================================
--- code/fred2/wing.cpp	(revision 4926)
+++ code/fred2/wing.cpp	(working copy)
@@ -337,12 +337,17 @@
 	for (i=0; i<total; i++) {
 		ptr = &Objects[wing_objects[wing_num][i]];
 		if (ptr->type == OBJ_SHIP)
-			remove_ship_from_wing(ptr->instance);
+			remove_ship_from_wing(ptr->instance, 0);
 		else if (ptr->type == OBJ_START)
-			remove_player_from_wing(ptr->instance);
+			remove_player_from_wing(ptr->instance, 0);
 	}
 
 	Assert(!Wings[wing_num].wave_count);
+
+	Wings[wing_num].wave_count = 0;
+	Wings[wing_num].wing_squad_filename[0] = '\0';
+	Wings[wing_num].wing_insignia_texture = -1;
+
 	Ship_editor_dialog.initialize_data(1);
 	Ship_editor_dialog.bypass_errors = Wing_editor_dialog.bypass_errors = 0;
 
@@ -350,6 +355,13 @@
 		set_cur_wing(cur_wing = -1);  // yes, one '=' is correct.
 	}
 
+	free_sexp2(Wings[wing_num].arrival_cue);
+	free_sexp2(Wings[wing_num].departure_cue);
+
+	Num_wings--;
+
+	update_custom_wing_indexes();
+
 	set_modified();
 }
 
