FEATURE: extendet the bugfix to also handle NaN values.