Fix the check for identifying row_number functions