fix bugs and extend rsync tests