Fixing a bug in partitioning.