Cleaned up Solver so it will be easier to debug.

Fixed potential bug in setupRoot.