Fix nasty memory leak instantiating new objects