Improved the token manager script.