Slightly less bad code (maybe) for delete that works in Chrome