Minor changes in token handling