Fix issues with upgrading.
Fix some more issues with the solver.