First step for primary key and small fixes