Remove non-exception-safe use of del