Fixed a bug in re-partitioning; added benchmark