Avoid OverflowException for uniques

Should be done in a cleaner way after checking $name type
Merge branch 'patch-1'