Removed debug-assert from last commit.
Only generate statistics if statistics.interval.ms is non-zero

Reported by Eugenio Peréz Martín