Plug memory leak with the help of valgrind +30% speed