Fixed memory overwrite problem in Solver