Fixes a bug with SftpStream.