Fix cactus_setup using breadth-first rather than post-order traversal