mode: Fix off-by-one in parsing mode-specific tokens.
Minor fixes.