Added waitFor() method to Worker.