Fix a nice bug:

Changed unique index to primary key, which caused dict and groupby to drop values, because results were no longer ordered.