more changes to get join reorder e.g. to work