Fix gc function.