Replace Debug.Assert with exception.