Use `reject` instead of `delete_if`

I forgot `delete_if` does its stuff in place, which causes all manner of breakage.