Fix gc bug; clean up gc.