Set numPartitions properly