Add an assert in a place to make it easier to find errors.