more coverage for qtree and queue
fix memory leaks