Fix for find_affected_records_for_index
Fix