When building a select field in civicrm, there is a value and a label. These get put into an array like:
$options[$value] = $label;
Eventhough this is an alphanumeric field, when you put something that looks like an integer (003) for instance into an array as an index, php converts it to its integer value automatically.
Patch is attached. Not sure if I'm checking for all the right data types. Please review.