[#1929] tmpfile management and port number correction