Fixed crash in max algorithm. Refs #9605
Merge remote-tracking branch 'origin/bugfix/9605_fix_crash_in_max_algorithm'