Added hooks for statistics collection.