fix initialisation of previous element and collection, fix comparison of path