Fix GC memory bug