Made this properly wait for completion, in the various cases we cover.