Fixes bugs in Root.java