Memleaks elimination