Tests and bugfix for the case where the dispatcher has finished before the worker started