--- /dev/null
+diff --git a/doc/lftp.1 b/doc/lftp.1
+index 2123b2c..6da6440 100644
+--- a/doc/lftp.1
++++ b/doc/lftp.1
+@@ -1749,8 +1749,8 @@ can try to set net:socket-buffer to relatively small value to avoid this.
+ limit accumulating of unused limit-total-rate. 0 means twice of limit-total-rate.
+ .TP
+ .BR net:max-retries \ (number)
+-the maximum number of sequential retries of an operation without success.
+-0 means unlimited.
++the maximum number of sequential tries of an operation without success.
++0 means unlimited. 1 means no retries.
+ .TP
+ .BR net:no-proxy \ (string)
+ contains comma separated list of domains for which proxy should not be used.
+diff --git a/po/es.po b/po/es.po
+index 27be471..8794a44 100644
+--- a/po/es.po
++++ b/po/es.po
+@@ -13,7 +13,7 @@ msgstr ""
+ "Language-Team: Spanish <es@li.org>\n"
+ "Language: es\n"
+ "MIME-Version: 1.0\n"
+-"Content-Type: text/plain; charset=ISO-8859-1\n"
++"Content-Type: text/plain; charset=UTF-8\n"
+ "Content-Transfer-Encoding: 8-bit\n"
+
+ #: lib/argmatch.c:133
+diff --git a/po/it.po b/po/it.po
+index 69aff39..2ffae57 100644
+--- a/po/it.po
++++ b/po/it.po
+@@ -12,7 +12,7 @@ msgstr ""
+ "Language-Team: Italian <it@li.org>\n"
+ "Language: it\n"
+ "MIME-Version: 1.0\n"
+-"Content-Type: text/plain; charset=ISO-8859-1\n"
++"Content-Type: text/plain; charset=UTF-8\n"
+ "Content-Transfer-Encoding: 8-bit\n"
+
+ #: lib/argmatch.c:133
+diff --git a/po/pt_BR.po b/po/pt_BR.po
+index 95e8e3d..5d1c02d 100644
+--- a/po/pt_BR.po
++++ b/po/pt_BR.po
+@@ -11,7 +11,7 @@ msgstr ""
+ "Language-Team: pt_BR <pt@li.org>\n"
+ "Language: pt_BR\n"
+ "MIME-Version: 1.0\n"
+-"Content-Type: text/plain; charset=ISO-8859-1\n"
++"Content-Type: text/plain; charset=UTF-8\n"
+ "Content-Transfer-Encoding: 8-bit\n"
+
+ #: lib/argmatch.c:133
+diff --git a/src/ChangeLog b/src/ChangeLog
+index a381272..e5e7c3f 100644
+--- a/src/ChangeLog
++++ b/src/ChangeLog
+@@ -1,3 +1,14 @@
++2013-05-21 Alexander V. Lukyanov <lav@yars.free.net>
++
++ * FileCopy.cc: set size=NO_SIZE when the size could not be found.
++ * FileSet.cc: allow info merging for files with the same basename.
++ * Fish.cc: fixed file correption and garbage logging by requiring
++ the file to have a size; improve error handling.
++
++2013-05-20 Alexander V. Lukyanov <lav@yars.free.net>
++
++ * Fish.cc: disconnect in more cases on Close.
++
+ 2013-05-13 Alexander V. Lukyanov <lav@yars.free.net>
+
+ * TorrentTracker.cc, TorrentTracker.h: use xstring for InfoHash and
+diff --git a/src/FileCopy.cc b/src/FileCopy.cc
+index 062b140..d0241c4 100644
+--- a/src/FileCopy.cc
++++ b/src/FileCopy.cc
+@@ -805,8 +805,7 @@ int FileCopyPeerFA::Do()
+ return MOVED;
+ }
+ FileInfo *fi=info[0];
+- if(fi->Has(fi->SIZE))
+- SetSize(fi->size);
++ SetSize(fi->size);
+ if(fi->Has(fi->DATE))
+ SetDate(fi->date);
+ session->Close();
+diff --git a/src/FileSet.cc b/src/FileSet.cc
+index a2f5255..49c9df4 100644
+--- a/src/FileSet.cc
++++ b/src/FileSet.cc
+@@ -48,7 +48,7 @@
+
+ void FileInfo::Merge(const FileInfo& f)
+ {
+- if(strcmp(name,f.name))
++ if(strcmp(basename_ptr(name),basename_ptr(f.name)))
+ return;
+ // int sim=defined&f.defined;
+ int dif=(~defined)&f.defined;
+diff --git a/src/Fish.cc b/src/Fish.cc
+index f467781..05870bd 100644
+--- a/src/Fish.cc
++++ b/src/Fish.cc
+@@ -341,10 +341,13 @@ void Fish::Close()
+ switch(state)
+ {
+ case(DISCONNECTED):
+- case(WAITING):
+ case(CONNECTED):
+ case(DONE):
+ break;
++ case(WAITING):
++ if(mode==STORE || mode==RETRIEVE)
++ Disconnect();
++ break;
+ case(FILE_SEND):
+ if(!RespQueueIsEmpty())
+ Disconnect();
+@@ -566,6 +569,8 @@ int Fish::HandleReplies()
+ Disconnect();
+ return MOVED;
+ }
++ if(entity_size!=NO_SIZE && real_pos<entity_size)
++ return m;
+ }
+ recv_buf->Put(pty_recv_buf->Get(),pty_recv_buf->Size()); // join the messages.
+ pty_recv_buf->Skip(pty_recv_buf->Size());
+@@ -616,8 +621,14 @@ int Fish::HandleReplies()
+ {
+ if(message==0)
+ message.set(line);
+- else
+- message.vappend("\n",line.get(),NULL);
++ else {
++ message.append('\n');
++ message.append(line);
++ if(state==FILE_RECV && mode==RETRIEVE) {
++ SetError(NO_FILE,message);
++ return MOVED;
++ }
++ }
+ return m;
+ }
+
+@@ -677,7 +688,7 @@ int Fish::HandleReplies()
+ else if(message && message[0]!='#')
+ {
+ FileInfo *fi=FileInfo::parse_ls_line(message,"GMT");
+- if(!fi)
++ if(!fi || !strncmp(message,"ls: ",4))
+ {
+ SetError(NO_FILE,message);
+ break;
+@@ -757,14 +768,14 @@ void Fish::CloseExpectQueue()
+ case EXPECT_PWD:
+ case EXPECT_CWD:
+ break;
+- case EXPECT_RETR_INFO:
+ case EXPECT_INFO:
+- case EXPECT_RETR:
+ case EXPECT_DIR:
+- case EXPECT_QUOTE:
+ case EXPECT_DEFAULT:
+ RespQueue[i]=EXPECT_IGNORE;
+ break;
++ case EXPECT_QUOTE:
++ case EXPECT_RETR_INFO:
++ case EXPECT_RETR:
+ case EXPECT_STOR_PRELIMINARY:
+ case EXPECT_STOR:
+ Disconnect();