Fix bug on rsync error handling