Avoid global memory leak

if not mocha generate " Error: global leaks detected: stringLength, tokenLength" and tests cannot be run