Adds memory leak tests