Fix regression bug in determining number of unpackings of a workflow and refactor a bit
Fix regression bug in determining number of unpackings of a workflow and refactor a bit

jhclark/ducttape,jhclark/ducttape,jhclark/ducttape