Fixing filtering deletes for indexing.

The logic there was just flat wrong. It was pretty close to right, but had some minor cases taht
lead to wrong answers in some cases