added better mem-leak tests