collection: improve name validation.