Make worker/wrapper robust to bogus unsafeCorece

Fixes Trac #8037