Fixed bug with several extra roots in extra classes

The variable is assigned the value of "2" on each iteration in the foreach loop. This results in all roots being root2.

Signed-off-by: Daniel Bondergaard <danielboendergaard@gmail.com>