Fixed formatting of non-ascending UIDs and indexes

Fixes issue #50