Added consistency check for lower and upper bounds in constrained demo.