Dev/collectionsync2

I think that is necesssary. Otherwise the matchin will fail in a tree like this:
* A
** B
*** C
** B
*** C