Fix unclosed begin/end block.