Fix for saving trial : added value validation during data cleanup before saving

Code review : Cyrus Venn Casada