Fix for dead indexes.

This should fix, or at least gracefully handle, dead indexes.