Add asserts to guard against regressions.