Improved topology parsing and tree construction.