Fixed a bug with db index for handler when retrieving statistics.