stub for cutpc, fix more mem leaks