Fix token generation