Using #delete_if to fix build in 1.8.7