Garbage collection fixes