Avoid OverflowException for uniques

Should be done in a cleaner way after checking $name type