fTools: fix MergeShapes and SpatialJoin
fix #7823
fix #7952
fix #8206