Fix an issue when there is no primary key