Fixed bugs when validating auth tokens.