Fixed GC bugs