Fixed bug caused by expanding the root vector.