Make statements inside blocks close when the parent block closes

Closes #186