Fixed memory leaks in teststl