Fix Issue 523

The index path refers the the original table data, not the filtered data. Adding a flag to let us refer to the unfiltered data fixes the fixes the issue.