fix more bugs in core