Fixed single primary key bug