Correctly convert between integer and string representations with qtpim