Fix an `AssertionError` exception introduced in v1.18.0rc1.