Sorry, I had a bit flipped. The definitions indeed happen in the inner frame. The two code fragments should be exchanged.