Added a type check to recursively cast constant record and list into a
string.