Index: /oup/current/Main.dfm
===================================================================
--- /oup/current/Main.dfm	(revision 53)
+++ /oup/current/Main.dfm	(revision 54)
@@ -374,5 +374,5 @@
     Top = 112
     Bitmap = {
-      494C01010D000E00040010001000FFFFFFFFFF00FFFFFFFFFFFFFFFF424D3600
+      494C01010D000E00040010001000FFFFFFFFFF10FFFFFFFFFFFFFFFF424D3600
       0000000000003600000028000000400000004000000001002000000000000040
       0000000000000000000000000000000000000000000000000000000000000000
@@ -906,5 +906,6 @@
       0000000000000000000000000000000000000000000000000000000000000000
       000000000000000000000000000000008001800180018001E007E007E007E007
-      F81FF81FF81FF81FFE7FFE7FFE7FFE7F}
+      F81FF81FF81FF81FFE7FFE7FFE7FFE7F00000000000000000000000000000000
+      000000000000}
   end
 end
Index: /oup/current/Main.pas
===================================================================
--- /oup/current/Main.pas	(revision 53)
+++ /oup/current/Main.pas	(revision 54)
@@ -600,5 +600,5 @@
     toolform         := TForm_BinEdit.Create(Self);
     toolform.Caption := 'Binary .dat-Editor ' + IntToStr(tag);
-    iconindex        := 4;
+    iconindex        := 5;
   end;
   if window_context = 'extractor' then
@@ -606,5 +606,5 @@
     toolform         := TForm_Extractor.Create(Self);
     toolform.Caption := 'Extractor ' + IntToStr(tag);
-    iconindex        := 7;
+    iconindex        := 8;
   end;
   if window_context = 'preview' then
@@ -612,5 +612,5 @@
     toolform         := TForm_Preview.Create(Self);
     toolform.Caption := 'Preview-Window ' + IntToStr(tag);
-    iconindex        := 3;
+    iconindex        := 4;
   end;
   if window_context = 'rawedit' then
@@ -618,5 +618,5 @@
     toolform         := TForm_RawEdit.Create(Self);
     toolform.Caption := 'Binary .raw-Editor ' + IntToStr(tag);
-    iconindex        := 5;
+    iconindex        := 6;
   end;
   if window_context = 'txmpreplace' then
@@ -624,5 +624,5 @@
     toolform         := TForm_TxmpReplace.Create(Application);
     toolform.Caption := 'TXMP Replacer ' + IntToStr(tag);
-    iconindex        := 6;
+    iconindex        := 7;
   end;
 
Index: /oup/current/Tools/Template.dfm
===================================================================
--- /oup/current/Tools/Template.dfm	(revision 53)
+++ /oup/current/Tools/Template.dfm	(revision 54)
@@ -49,4 +49,5 @@
       PopupMenu = filepopup
       TabOrder = 0
+      OnClick = listClick
       OnMouseDown = listMouseDown
     end
Index: /oup/current/Tools/Template.pas
===================================================================
--- /oup/current/Tools/Template.pas	(revision 53)
+++ /oup/current/Tools/Template.pas	(revision 54)
@@ -278,6 +278,6 @@
   pt.X := x;
   pt.Y := y;
-  filelist.ItemIndex := filelist.ItemAtPos(pt, true);
-  Self.listClick(Self);
+//  filelist.ItemIndex := filelist.ItemAtPos(pt, true);
+//  Self.listClick(Self);
 end;
 
Index: /oup/current/Tools/TxmpReplace.pas
===================================================================
--- /oup/current/Tools/TxmpReplace.pas	(revision 53)
+++ /oup/current/Tools/TxmpReplace.pas	(revision 54)
@@ -31,4 +31,5 @@
     OniImage_Old: TOniImage;
     OniImage_New: TOniImage;
+    old_size: Integer;
     fileid: Integer;
   public
@@ -58,4 +59,5 @@
 
   OniImage_Old.LoadFromTXMP(fileid);
+  old_size := OniImage_Old.GetImageDataSize((fadingbyte and $01) > 0);
   Data := OniImage_Old.GetAsBMP;
   mem  := TMemoryStream.Create;
@@ -92,5 +94,5 @@
 procedure TForm_TxmpReplace.btn_replaceClick(Sender: TObject);
 var
-  oldsize, newsize: LongWord;
+  newsize: LongWord;
   old_rawaddr, new_rawaddr: LongWord;
   oldfading: Byte;
@@ -121,6 +123,4 @@
     end;
 
-    oldsize := OniImage_Old.GetImageDataSize((oldfading and $01) > 0);
-
     if check_fading.Checked then
       if not OniImage_New.GetMipMappedImage(tempd) then
@@ -137,7 +137,6 @@
 
     newsize := OniImage_New.GetImageDataSize(check_fading.Checked);
-    ShowMessage(IntToStr(newsize));
-
-    if (newsize > oldsize) and (OniDataConnection.Backend = ODB_Dat) then
+
+    if (newsize > old_size) and (OniDataConnection.Backend = ODB_Dat) then
       new_rawaddr := OniDataConnection.AppendRawFile(
         OniDataConnection.OSisMac, Length(tempd), tempd)
