Ranking named query fix bug.