a) Fix trends ranker
b) Fix query formulator