Fixed restoring fragments again, this time probably for real.  Also fixed an issue with saving statistics in the case of undefined values.