Fix an assertion failure in debugging builds