Enable state restoration for stats.

Fixes #1340