speed up ptsj by merging duplicates, replace 0 empty item with 1 item in root