Fixed bug with constraint violation