MDL-32076 core_grade: fixed handling of unlimited grades