insert some conversions to make custom Integer types more likely to
work with indexing. fixes #3106