[BACKPORT] Fix #1409 - Exception when doing pop rounding on nans

[BACKPORT] Fix #1409 - Exception when doing pop rounding on nans