Fix renamed "total" variable (#92287)

* Fix renamed "total" variable
* Keep nan/inf handling consistent between versions
1 file changed