(ITS#8230) [PATCH] totp: bug fixes and improvements