Fix end statements.