Fix BEGIN blocks, they get outer lexicals and can return a value. Add a test.