Fixed memory leak, added static variable in VecND class to check for memory leaks