Improved defined name validation.