improve fix to cast named types to integers for conversion ops