fix more checks (mainly the outer scope and class def)