Fixed a bug where an extra secondary root was detected