Fix for reverting cvalueid for categorical variate when it is invalid data

Reviewer: Chezka Arevalo

Issue: GCP-9863