Fixed a bug in the constraint solver.