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)
