Fixed bugs in how worker is passed in createWorker().