Fixed crashes in Constraints and Solver.