Fix shortname validation logic.