Fix definition of this_partition().
Fix test for dynamic partitions.
Remove tasknum from task msg.