Fixed worker cleanup bug