Rename index to idx to avoid symbol conflicts.