Fix bad token handling