This fixes incompatibilities introduced by a new R version in d16c38a2 It also fixes #25315 as a result.