Added Visual Leak Detection and fixed memory leak. AH-293