Fix #1730 right id column used

As title says.