Added a hack to determine if a character is valid