Token renew and many bugfixes