Make convert_code_to_value robust to both possible datatypes of value_to_code.