Added special cases when check the constraints.