Added precondition checks for worker/wrapper.