Made a few changes to make sure the root node was always placed properly.