Added extra validation to cas.
Fix after merge.