behave correctly on closing }

closes gh-4