added a test for undefined names, removed __main__ from test.