Some improvements to the solver code.