Fixed a bug with equality constraints