The above code needed to be inside the converge_by block, and in general this needs a pass to make it whyrun-safe.