Added support to gather stats.