fix handling of variable length ints