tokenize: add missing mode name length check