A couple small changes to #438.

* Move common code to the base class.
* Rethrow, rather than Debug.Assert.