Fixed some issues with memory leaks and bogus memory leak reporting (when destructor called via method reference or rtti).