Fix token handling