Improve character name checking