fixed a bug with mixed soft and hard constraints