Add chain sync test

- Added test for syncs tomes in a chain: a -> b -> c.
- Moved check on diff if null outside the for loop in the sync function
to avoid looping through all the targets.