corrections some bugs: query counter, analytics, etc.

Signed-off-by: loopasam <samuel.croset@gmail.com>