fixed the segfault
added setParent calls to generateJoinTree
-> it compiles but the result is not correct