Fix inconsistent leading zeroes again

Previous fix did not take into account that leading zeroes would not be
present for a range between 1-5. Leading zeroes were only being used
when the end of a range was made up of more than one digit (for example,
1-10).