Fix empty partitions

Couple of fixes to avoid hanging if we have empty partitions in parallel.