Fixed phase 2 partitions pointers.
This is not strictly necessary, but I don't want the pointers pointing to garbage
if I ever need to use them later.
Also changed the data generation function for testing duplicates temporarily.
Removed dead code.
Added verification output.
Fixed bugs in skipping duplicate pivots.
Merge branch 'feature/duplicates' into develop