Fixed crash in max algorithm. Refs #9605
Merge branch 'bugfix/9605_fix_crash_in_max_algorithm' into develop