Issue #2396793 by xjm: Token API will match tokens with empty types or tokens, e.g. [:invalid]