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