some fixes, but gc doesn't work fully