Fix bugs in the Worker, add tests.