Fixed bugs with ftp upload.