Fix an assert (and tests in --debug mode) after #921.