Issue #22856:fix nulls and divide by zero