Fix problems with garbage collector.