Improved defined name validation.

Issue #82.