Check for token type.

Signed-off-by: crynobone <crynobone@gmail.com>