Fixed pickling of stats file