Fixed partition_weighted.
Added a test for pmap.