Fix for saving error that happens when a treatment factor is deleted prior to a save operation

Post commit code review : Chika Arevalo