Addressed the serialization problem with interim files getting too big.