Fixing bugs in tree layouts