Avoid using the type_info for enumerations, as it is wrong.

This is a fix for the segfaults that occur in most relvals and addon tests in the latest IB.
Please merge in time for the next IB, or sooner.