Fix a constraint bug (#580).