Corrected compile errors in case DB_ENABLE_STATS is defined [Credits: Haruna]

Signed-off-by: Jedzkie <jedzkie13@rocketmail.com>