Fix root_builder method

If there is only one kv node in the tree, a corner case has to be handled.