Fixes SFTP upload code