fixed some memory leaks in DeterministicSolver