More work on turning traces into trees.