Index: code/fred2/fred.rc
===================================================================
--- code/fred2/fred.rc	(revision 11257)
+++ code/fred2/fred.rc	(working copy)
@@ -1928,7 +1928,7 @@
     PUSHBUTTON      "Cancel",IDCANCEL,239,35,50,14
     LTEXT           "Old texture:",IDC_LABEL1,7,7,44,9
     LTEXT           "New texture:",IDC_LABEL2,152,7,44,9
-    COMBOBOX        IDC_OLD_TEXTURE_LIST,7,16,137,85,CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_TABSTOP
+    COMBOBOX        IDC_OLD_TEXTURE_LIST,7,16,137,85,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
 END
 
 IDD_SPECIAL_HITPOINTS DIALOG  0, 0, 234, 85
Index: code/fred2/shiptexturesdlg.cpp
===================================================================
--- code/fred2/shiptexturesdlg.cpp	(revision 11257)
+++ code/fred2/shiptexturesdlg.cpp	(working copy)
@@ -126,7 +126,9 @@
 		{
 			if (!stricmp(ii->ship_name, Ships[self_ship].ship_name))
 			{
-				end--;
+				do {
+					end--;
+				} while (end != ii && !stricmp(end->ship_name, Ships[self_ship].ship_name));
 				if (end == ii)
 					break;
 				texture_set(&(*ii), &(*end));
@@ -134,7 +136,7 @@
 		}
 
 		if (end != Fred_texture_replacements.end())
-			Fred_texture_replacements.erase(end);
+			Fred_texture_replacements.erase(end, Fred_texture_replacements.end());
 
 		// now put the new entries on the end of the list
 		for (i=0; i<texture_count; i++)
@@ -217,20 +219,22 @@
 			// make old texture lowercase
 			strlwr(texture_file);
 
-			// now add it to the box
-			z = box->AddString(texture_file);
-
-			// and add it to the field as well
+			// add it to the field
 			strcpy_s(old_texture_name[texture_count], texture_file);
 
 			// increment
 			texture_count++;
-
-			// sort
-			sort_textures();
 		}
 	}
 
+	// now sort the filenames
+	sort_textures();
+
+	// and add them to the box
+	for (i=0; i<texture_count; i++) {
+		z = box->AddString(old_texture_name[i]);
+	}
+
 	// now look for new textures
 	for (SCP_vector<texture_replace>::iterator ii = Fred_texture_replacements.begin(); ii != Fred_texture_replacements.end(); ++ii)
 	{
