Fix index usage in batch operations