Fixes to token validation.