Fix saving of factors

Reviewer: Tiffany Go

Issue: GCP-8708