Improve RepIds.fixName implementation