Deal with parent_root_id > root_id. Closes #7, #8.