Do not overwrite idx when setting metadata
Since the index in the table is 1-based and the index we were setting is
0-based, this would write the wrong index. Also, we should not adjust the
position (and as such the index) when updating the metadata column.