Refs #19978 - Fix mathing alghorithm