fixed tri-state, weird root-node, and layout on tree