Fix query in calculateRecentStatsAndRanks