Removes unmatched end