Fixed rsync-check function