You should add ` && MCValueGetTypeCode(t_valueref) == kMCValueTypeCodeString` in that `if` - and, according to the type expected, in the following ones as well