Changed an assert into a guarantee.