Fixed bug in solver.