minor fixes to worker.js