Fix name length check

See changes