ref #1444, ref #8508, ref #8509 improve rank handling in ERMS pipeline